JViewLegacy::assign
Assigns variables to the view script via differing strategies.
This method is overloaded; you can assign all the properties of an object, an associative array, or a single value by name. You are not allowed to set variables that begin with an underscore; these are either private properties for JView or private variables within the template script itself. <code> $view = new JView; // Assign directly $view->var1 = 'something'; $view->var2 = 'else'; // Assign by name and value $view->assign('var1', 'something'); $view->assign('var2', 'else'); // Assign by assoc-array $ary = array('var1' => 'something', 'var2' => 'else'); $view->assign($obj); // Assign by object $obj = new stdClass; $obj->var1 = 'something'; $obj->var2 = 'else'; $view->assign($obj); </code>
Signature
public function assign()
Returns
- boolean
- True on success, false on failure.