一,单个view中:
写到方法最后fetch操作之前:
//列出所有新房
public function list() {
...
$config = $this->view->config;
$config['jsname'] = '';
$this->assign('config', $config);
return $this->view->fetch('list');
}
二,整个php类中:
写到类的初始化方法中即可
public function _initialize()
{
parent::_initialize();
//$this->model = new \app\admin\model\testdir\Test;
$config = $this->view->config;
$config['jsname'] = '';
$this->view->config = $config;
//$this->assign('config', $config);
}
标签:function,jsname,js,fastadmin,页面,config,public,view From: https://www.cnblogs.com/architectforest/p/18424148