disable smarty notice

user669677 picture user669677 · Jul 22, 2011 · Viewed 7k times · Source

I would like to disable smarty-s notices.

This exactly:

Notice: Undefined variable: xy

Because I know that some variables are undefined and in some cases I don't even want to define them.

BUT I don't want to disable other PHP notices.

Thanks for help!

Answer

Johan picture Johan · Jul 22, 2011

You should use this: http://www.smarty.net/docs/en/variable.error.reporting.tpl

Just set

$smarty->error_reporting = E_ALL & ~E_NOTICE;