trq
-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Posts posted by trq
-
-
Actually, there is a library that might be able to help you, just can't think of the name of it off the top of my head.
Give me a second.
-
Yeah, if you can't change that function, that isn't going to happen.
-
return will work as expected.
<?php function a() { include 'file.php'; echo 'work'; }
file.php<?php echo 'play'; return; echo 'this will not be reached';
-
Anyone actually use this technique?
I wouldn't. I much prefer to go the template route. A *very* simple example:
<?php function renderTemplate($template, array $data = []) { extract($data); include $template; }
template.html.php<table width="100%" cellpadding="12" cellspacing="0" border="0"> <tr bgcolor ="black"> <td align ="left"><img src = "logo.gif" /></td> <td> <h1><?= $heading; ?></h1> </td> <td align ="right"><img src = "logo.gif" /></td> </tr> </table>
<?php renderTemplate('template.html.php', ['heading' => 'TLA Consulting Pty Ltd']);
-
No interface do not include implementation.
-
So basically unset is the equivalent of setting an initialized value in Java back to null.
I don't think so. Unsetting a variable is like it was never initialized at all.
-
By your definition it does not support function overloading.
-
I know that Rackspace do "Managed Operations" but at this point it is far too expensive.
That is indeed what your looking for. It's not cheap, no.
If you can find a freelance devops guy you could go down that route (hint hint). We have a freelance board, but I'm not sure where else you might search or how much activity you might get.
-
This is one of php's little quirks, there is no way to fix it now without breaking BC. Live with it.
-
Who cares?
- 1
-
Thanks. I wanted to try it before it goes "live", because I'm not sure that it's working, if you say the code is ok I ll try and let you know . Thanks
You "try before it goes live" by installing a local http server to use when developing. You won't get any php working without one.
-
Do you have some relevant code?
-
Should it look like this?
<p class="submit"> <input type="submit" formaction="form-to-email.php" name="submit" id="submit" value="Send message"> </p>
No, the code you're have in your form is fine. Judging from your error, you don't have a server setup. PHP requires a http server configured to execute PHP. You then need to access your site via urls, not file paths. eg; http://localhost/index.html, not file:///C:/ etc
-
No you don't need to "link" them, the form just needs to submit to your php script (by setting it as the action).
-
Your closing theEnd needs to be at the start of the line.
-
If this script is being executed by requested it via a web server then the script executes as that web server.
eg; On a typical Debian machine, Apache Http for instance will be running as the www-data user.
-
What the hell are these classes? I mean, why does an Action extend a View in the first place? The two seem unrelated.
-
It's pretty hard to write SOLID code without interfaces.
- 1
-
People still use things like Wampserver?
I thought we'd all moved to reproducible development environments via Vagrant?
-
using the little info you gave maybe something like
$newObj = Google_Service_Calendar_Acl_Resource();
That assumes Google_Service_Calendar_Acl_Resource is a function which it is not.
-
This obviously wont work because it overrides the joomla autoloading function
It shouldn't. spl_autoload_register adds autoloaders onto a stack of autoloaders. So, unless Joomla is doing something funky with its autoloading, your implementation looks fine.
Another option to consider would be to simply use Composer. All you need to do then is include composer's autoloader into your project somewhere.
-
That code is in some serious need of being thrown out.
The session_is_registered function is deprecated.
The mysql_* extension is deprecated
Short tags have long been disabled by default.
And in general it's just poor code. Moving forward, you might want the code maintained.
- 1
-
Don't put it within your http server's document root. There is no reason it needs to be executed via http.
-
We are not here to fix code for people. If you have a specific question, ask it.
Exit Function Early
in PHP Coding Help
Posted
I've not used this myself, just remember reading about it: http://go.aopphp.com
Looks interesting yet scary.