- 7.2. Opt_View class
7.2.6. assign() - 7.2.5. __unset()
« Previous - 7.2.7. assignGlobal()
Next »
7.2.6. assign()
| Construct | Method |
|---|---|
| Visibility | public |
| Reference | void Opt_View::assign( string $name, mixed $data ) |
Assigns the $data to the local template variable $name:
$view->assign('object', 'sunglasses');
The template:
<p>Hello my friend, do you need {$object}?</p>
You may also create a variable value using the magic method Opt_View::__set():
$view->variable = 'foo'. It is the recommended solution.
See also:
- 7.2.6. assign()
7.2. Opt_View class - « Previous
7.2.5. __unset() - Next »
7.2.7. assignGlobal()