|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
maka Smarty Rookie
Joined: 15 May 2003 Posts: 21 Location: Maringá-PR BRASIL
|
Posted: Wed Oct 01, 2003 6:43 pm Post subject: @ supress error message |
|
|
Is it possibel to use the @ operator?
I mean, I don't wanto put |default:"value" for every template var in my template. And I don't wanto ignore notice, i just want to ignore the inexistent of a template variable. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Oct 01, 2003 8:48 pm Post subject: |
|
|
smarty ignores E_NOTICE by default. only with $smarty->debugging=true notices about unknown template variables are emitted. set error_reporting(E_ALL^E_NOTICE) before you call display() if you don't wan't this with enabled debugging.
HTH
messju |
|
Back to top |
|
maka Smarty Rookie
Joined: 15 May 2003 Posts: 21 Location: Maringá-PR BRASIL
|
Posted: Wed Oct 01, 2003 9:12 pm Post subject: |
|
|
debugging is false. I'm getting Notice errors cause I'm using myErrorHandler. When I turn off it, works fine.
The problem is that error_reporting(E_ALL^E_NOTICE); is not working if I set a mine errorHandler.
I make a simple test like this:
error_reporting(E_ALL^E_NOTICE);
echo test;
and a notice is raised. is that normal? do I have to create my own error_reporting function to control my errorHandler?
perhaps a php bug, cause I made the follow test
error_reporting(0);
echo test;
and works fine. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Oct 01, 2003 9:37 pm Post subject: |
|
|
you'll have to filter E_NOTICE yourself by $errno in your custom error-handler.
greetings
messju |
|
Back to top |
|
maka Smarty Rookie
Joined: 15 May 2003 Posts: 21 Location: Maringá-PR BRASIL
|
Posted: Wed Oct 01, 2003 9:56 pm Post subject: |
|
|
very thanks!
Now my errorHandler works with php's error_reporting and display_errors functions!!! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|