【问题标题】:Unable to change admin prefix in cakephp 1.3无法在 cakephp 1.3 中更改管理员前缀
【发布时间】:2013-05-22 11:44:56
【问题描述】:

我已经使用前缀“webadmin”建立了我的 cakephp 站点的管理员。现在我需要将其更改为“aRRT6nnf”之类的内容。

我更改了 core.php、routes.php 中的管理员前缀,甚至更改了 views 文件夹中的文件名,但这会出现以下错误:

Error: The requested address '/aRRT6nnf' was not found on this server.

我进行了以下更改以实现此目的:

//core.php
Configure::write('Routing.prefixes', array('aRRT6nnf'));

//routes.php
Router::connect('/aRRT6nnf', array('controller' => 'dashboard', 'action' => 'index', 'prefix'=>'aRRT6nnf', 'aRRT6nnf'=>true));

任何帮助将不胜感激。

【问题讨论】:

    标签: php cakephp


    【解决方案1】:

    您是否更改了控制器方法的前缀

    在 Cake 1.3 中使用管理路由时,您的控制器操作需要以它们所属的路由作为前缀,例如路由 admin 您的仪表板控制器应该是这样的

    class DashboardController extends AppController
    {
    
        public admin_index() {
    
        }
    

    因此,在您的具体情况下,您需要将它们更改为

    public aRRT6nnf_index() {
    
    }
    

    【讨论】:

    • 是的,我更改了控制器方法的前缀,但它不起作用。
    猜你喜欢
    • 2012-09-16
    • 1970-01-01
    • 1970-01-01
    • 2016-11-26
    • 1970-01-01
    • 2013-08-23
    • 2015-12-24
    • 1970-01-01
    • 2016-11-21
    相关资源
    最近更新 更多