Caching plugin and normal controllers with duplicate names

前端 未结 3 1885
甜味超标
甜味超标 2021-01-27 12:28

I\'m running into a problem related to caching, plugins and duplicate model names in Cake 2.0. My application has several controllers containing only actions for public use (vie

3条回答
  •  囚心锁ツ
    2021-01-27 13:05

    Are there conflicting routes between the main app and the plugin? This sounds like you may need to create a route for your /posts and another for /admin/posts in your main app. This should override the routes from the plugin causing any conflict. Of course, clear your cache before trying the change.

    //main app posts route
    Router::connect(
        '/posts',
        array(
            'controller' => 'Posts'
            'action' => 'index'
        )
    );
    
    //plugin posts route
    Router::connect(
        '/admin/posts',
        array(
            'controller' => 'Posts'
            'action' => 'index',
            'plugin' => 'CmsPlugin'
        )
    );
    

提交回复
热议问题