PHP 8.6.0 Beta 3 is available for testing

Yaf_View_Simple::clear

(Yaf >=2.2.0)

Yaf_View_Simple::clearRemove an assigned variable

Açıklama

public function Yaf_View_Simple::clear(string $name = NULL): bool

Removes an assigned variable from the view. When called without an argument, all assigned variables are removed.

Bağımsız Değişkenler

name

The name of the variable to remove, or omitted/null to remove all assigned variables.

Dönen Değerler

Returns true.

Örnekler

Örnek 1 Yaf_View_Simple::clear() example

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        $this->getView()->clear("foo")->clear("bar"); // clear "foo" and "bar"
        $this->_view->clear(); // clear all assigned variables
    }
}
?>

Ayrıca Bakınız

add a note

User Contributed Notes

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