Re: [SMARTY] Deafult:"None" and set_error_handler [RESOLVED]
| From: | Nick Clarke | Date: | Thu, 24 Mar 2005 12:05:37 +0000 |
| Subject: | Re: [SMARTY] Deafult:"None" and set_error_handler [RESOLVED] | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12364@lists.php.net to get a copy of this message | ||
Thanks to messju for his reply.
I now suppress E_NOTICE errors from stopping the processing and now Smarty works like a dream.
Nick
messju email:-
-----------------------------------------------------------------------------------------------------------------
php issues an E_NOTICE because $TMP is undefined. smarty suppresses
this NOTICE with the @-error-control-operator, but your
custom-error-handler gets called nontheless.
from: http://php.net/set_error_handler
"It is important to remember that the standard PHP error handler is
completely bypassed. error_reporting() settings will have no effect
and your error handler will be called regardless - however you are
still able to read the current value of error_reporting and act
appropriately. Of particular note is that this value will be 0 if the
statement that caused the error was prepended by the @ error-control
operator."
HTH
messju
-----------------------------------------------------------------------------------------------------------------
Nick Clarke <> wrote:
Hi,
I have just started using Smarty as my new template engine. It is a 10000 time improvement on what I
have been using up until now. I have run into a little problem though when using defaults
When I create a simple standalone script all works well and runs without a problem. Here comes the
BUT :)
When I plug it into my framework it kills dies!
I get errors saying:
Undefined index: TMP (Error Code: 8) File: (/smarty/templates_c/%%89^893^893B2242%%home.tpl.php)
Line: (43)
If I turn off my custom php error handler (set_error_handler) it works without a problem!!!
So I guess the question is has anyone used Smary and a custom error handler, as I guess Smarty is
raising a warning or error when in-fact I just want it to set the default.
Thanks in Advance,
Nick
Send instant messages to your online friends http://uk.messenger.yahoo.com
Send instant messages to your online friends http://uk.messenger.yahoo.com