1

我启用了管理员路由。如何设置路由,使http://website.com/admin转到 posts/admin_index?

我有这个:

Router::connect('/', array('controller' => 'posts', 'action' => 'index'));

但这似乎不起作用。我收到此错误(访问 http://website.com/admin时):

Missing Controller

Error: Controller could not be found.

Error: Create the class Controller below in file: app/controllers/controller.php

<?php
class Controller extends AppController {

    var $name = '';
}
?>
4

1 回答 1

3

尝试以下路线:

Router::connect('/admin', array('controller' => 'posts', 'action' => 'index', 'admin' => true));

默认路由'/'与 URL 不匹配'/admin',管理员路由是否启用。

于 2010-02-13T01:46:50.057 回答