CakeFest 2024: The Official CakePHP Conference

Yaf_View_Simple::clear

(Yaf >=2.2.0)

Yaf_View_Simple::clear清除分配的值

说明

public Yaf_View_Simple::clear(string $name = ?): bool

清除分配的变量

参数

name

分配的变量名

如果为空,将会清除所有分配的变量

返回值

示例

示例 #1 Yaf_View_Simple::clear() 示例

<?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
}
}
?>

参见

add a note

User Contributed Notes

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