Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

@ supress error message

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
maka
Smarty Rookie


Joined: 15 May 2003
Posts: 21
Location: Maringá-PR BRASIL

PostPosted: Wed Oct 01, 2003 6:43 pm    Post subject: @ supress error message Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Oct 01, 2003 8:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
maka
Smarty Rookie


Joined: 15 May 2003
Posts: 21
Location: Maringá-PR BRASIL

PostPosted: Wed Oct 01, 2003 9:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Oct 01, 2003 9:37 pm    Post subject: Reply with quote

you'll have to filter E_NOTICE yourself by $errno in your custom error-handler.

greetings
messju
Back to top
View user's profile Send private message Send e-mail Visit poster's website
maka
Smarty Rookie


Joined: 15 May 2003
Posts: 21
Location: Maringá-PR BRASIL

PostPosted: Wed Oct 01, 2003 9:56 pm    Post subject: Reply with quote

very thanks!
Laughing
Now my errorHandler works with php's error_reporting and display_errors functions!!!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP