开发者

cakephp 1.3.11 plugin routing not working

开发者 https://www.devze.com 2023-03-25 19:56 出处:网络
I\'m building a blog plugin for CakePHP. It is called \'blog\'. I am following the manual on plugin routing but my links won\'t work.http://book.cakephp.org/view/951/Plugin-routing

I'm building a blog plugin for CakePHP. It is called 'blog'.

I am following the manual on plugin routing but my links won't work. http://book.cakephp.org/view/951/Plugin-routing

For example, when I am on this page: appname/blog/posts/index, I have a link to the index action of the users plugin. So I built my link as follows:

echo $this->Html->link(
    __('List Users', true), 
    array(
        'plugin' => 'users', 
        'controller' => 'users', 
        'action' => 'index'
    )
);

But the link keep pointing to app/blog/users/index 开发者_如何转开发instead of app/users/users/index. Why is that?

PS: users is also a plugin (from CakeDC).


you can set routes like this:

   Router::connect('/users', array('admin' => false, 'plugin' => false, 'controller' => 'tests', 'action' => 'test') );

'admin' is for admin routing and 'plugin' for plugin url.

0

精彩评论

暂无评论...
验证码 换一张
取 消