PHP 8.6.0 Beta 3 is available for testing

Yaf_View_Simple::__isset

(Yaf >=1.0.0)

Yaf_View_Simple::__issetCheck whether a variable is assigned

Descrizione

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.

Elenco dei parametri

name

The name of the variable to check.

Valori restituiti

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

Esempi

Example #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));
    }
}
?>

Il precedente esempio visualizzerà qualcosa simile a:

bool(true)
bool(false)

Vedere anche:

add a note

User Contributed Notes

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