7.2. Opt_View class
7.2.13. defined()
7.2.12. clear()
« Previous
7.2.14. definedGlobal()
Next »

7.2.13. defined()

ConstructMethod
Visibilitypublic
Referenceboolean defined( string $name )

Returns true, if there already exists a local template variable $name assigned to the current view.

if(!$view->defined('foo'))
{
    $view->foo = $someValue;
}

Alternatively, you may use the following syntax:

if(!isset($view->foo))
{
    $view->foo = $someValue;
}

See also:

7.2.13. defined()
7.2. Opt_View class
« Previous
7.2.12. clear()
Next »
7.2.14. definedGlobal()