无法在cakephp 1.3中更改管理员前缀

时间:2013-05-22 11:44:56

标签: php cakephp

我使用前缀'webadmin'构建了我的cakephp网站的管理员。现在我需要将其更改为'aRRT6nnf'。

我更改了core.php,routes.php中的admin前缀,甚至更改了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));

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:1)

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

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

class DashboardController extends AppController
{

    public admin_index() {

    }

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

public aRRT6nnf_index() {

}