fastadmin: 避免引入页面同名js

一,单个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);
    }

 

posted @ 2024-09-21 16:18  刘宏缔的架构森林  阅读(7)  评论(0编辑  收藏  举报