PHP 8.5.10 Released!

Yaf_View_Simple::__isset

(Yaf >=1.0.0)

Yaf_View_Simple::__issetCheck whether a variable is assigned

Опис

public function Yaf_View_Simple::__isset(string $name): bool

Checks whether a variable is assigned to the view. This method is called when isset() is used on a view object.

Параметри

name

The name of the variable to check.

Значення, що повертаються

Returns true if a variable is assigned under name, false otherwise.

Приклади

Приклад #1 Yaf_View_Simple::__isset() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        $view = $this->getView();
        $view->assign("title", "Welcome");

        var_dump(isset($view->title));
        var_dump(isset($view->unknown));
    }
}
?>

Поданий вище приклад виведе щось схоже на:

bool(true)
bool(false)

Прогляньте також

add a note

User Contributed Notes

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