Change admin layout in CakePHP

后端 未结 4 1423
旧时难觅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:04

    Create a app/app_controller.php and put this in:

    params['prefix']) && $this->params['prefix'] == 'admin') {
                $this->layout = 'admin';
            } 
        }
    
    }
    

    Don't forget to call parent::beforeFilter(); in your controllers if you use it in other controllers.

    Semi related to the question, you don't need the routes defined, you just need to enable Routing.admin config option and set it to admin in the app/config/core.php. (CakePHP 1.2)

提交回复
热议问题