Change admin layout in CakePHP

后端 未结 4 1412
旧时难觅i
旧时难觅i 2021-02-15 09:17

I am working in cakephp, and I have the following two lines in my /app/config/routes.php file:

/**
 * ...and setup admin routing
 */
 Router::connect(\'/admin/:c         


        
4条回答
  •  感动是毒
    2021-02-15 10:03

    For CakePHP 3.X you should edit your src/View/AppView.php file and add the following code to your initialize() method:

    public function initialize()
    {
        if ($this->request->getParam('prefix') === 'admin') {
            $this->layout = 'Plugin.layout';
        }
    }
    

提交回复
热议问题