Yaf_View_Simple::__set
PHP function
Edit on GitHub ✎
(Yaf >=1.0.0)
Assign a variable via property write
Description
Yaf_View_Simple::__set(string $name, mixed $value): void
Assigns a variable to the view. This method is called when writing to a property of a view object, and behaves the same as Yaf_View_Simple::assign.
Parameters
nameThe name under which the variable becomes available to the template.
valueThe value to assign.
Return Values
No value is returned.
Examples
Yaf_View_Simple::__set example
php
<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
$this->getView()->foo = "bar"; // same as assign("foo", "bar");
}
}
?>See Also
Yaf_View_Simple::assignYaf_View_Simple::get