PHP 8.6.0 Beta 2 available for testing

Yaf_View_Simple::__set

(Yaf >=1.0.0)

Yaf_View_Simple::__setAssign a variable via property write

Description

public function 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

name

The name under which the variable becomes available to the template.

value

The value to assign.

Return Values

No value is returned.

Examples

Example #1 Yaf_View_Simple::__set() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        $this->getView()->foo = "bar"; // same as assign("foo", "bar");
    }
}
?>

See Also

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top