SMARTY 3: Throw exception(not Notice) if variable undefined
Question
Is there a way to force Smarty 3 throw exceptions instead of notices? I want application to crash in there is undefined variable. In smarty 2 there was error_unassigned param, but looks like it's removed in v3.
Solution
$smarty->error_unassigned = true;
still exists. A method to throw Exceptions on unassigned variables does not exist (yet), though. You could set_error_handler() to convert the notice to an exception.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow