Quick Note 040411

Use smarty function to check if a smarty variable has been set.

if($smarty->get_template_vars('some_var') == 'off')
 //do something
if ($smarty->get_template_vars('some_var') === null)
//mean smarty variable, some_var is not set

use === or !== instead of == or !=

Says, $foo = true; $foo != ‘hello world’ is not true. So you have to do the following,

$foo = true;
if($foo !== 'hello_world'){
  echo $foo;

Leave a Reply

Your email address will not be published. Required fields are marked *