略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_View_Simple::clear

2024-05-02

Yaf_View_Simple::clear

(Yaf >=2.2.0)

Yaf_View_Simple::clearClear Assigned values

说明

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

清除指定的变量

参数

name

分派的变量名

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

返回值

范例

示例 #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
    
}
?>

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/yaf-view-simple.clear.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3