2014-01-09 71 views
0

我在我的網站上使用了來自www.milesj.me的作曲者安裝了cakephp論壇插件和管理插件。論壇和管理員插件已成功安裝。cakephp:管理員插件衝突

但管理員插件正與現有網站管理員面板發生衝突。現有站點的URL是localhost/domain/admin,這也是Admin插件的相同URL。

有沒有人知道如何解決這個衝突?

謝謝。

回答

0

你的配置/ core.php中:

/** 
* Uncomment the define below to use CakePHP prefix routes. 
* 
* The value of the define determines the names of the routes 
* and their associated controller actions: 
* 
* Set to an array of prefixes you want to use in your application. Use for 
* admin or other prefixed routes. 
* 
* Routing.prefixes = array('admin', 'manager'); 
* 
* Enables: 
* `admin_index()` and `/admin/controller/index` 
* `manager_index()` and `/manager/controller/index` 
* 
*/ 
Configure::write('Routing.prefixes', array('admin')); 

由於管理插件已經使用與管理的網址,將其設置爲不同的值。

請記住,您的控制器中現有的'管理員'方法也必須更改(例如從admin_index()到_index())。

+0

您提到的行已被取消註釋。 – user3153854

+0

您是否嘗試將「管理員」更改爲其他內容,例如'siteadmin'? – savedario

+0

是的,但它給出了錯誤,然後...我想知道這是常見的問題,沒有人有這個答案,即使我GOOGLE了它,找不到答案... – user3153854

0

也許你可以嘗試修改應用/插件/管理/配置/ routes.php文件是這樣

/* 
    Router::connect('/admin/'. $section . '/:action/*', $menu['url'], array('section' => $section)); 
    Router::connect('/admin/'. $section, $menu['url'] + array('action' => 'index'), array('section' => $section)); 
    */ 
    Router::connect('/dash/'. $section . '/:action/*', $menu['url'], array('section' => $section)); 
    Router::connect('/dash/'. $section, $menu['url'] + array('action' => 'index'), array('section' => $section)); 
} 
/* 
Router::connect('/admin/:model/:action/*', 
    array('plugin' => 'admin', 'controller' => 'crud'), 
    array('model' => '[_a-z0-9]+\.[_a-z0-9]+')); 
*/ 
Router::connect('/dash/:model/:action/*', 
    array('plugin' => 'admin', 'controller' => 'crud'), 
    array('model' => '[_a-z0-9]+\.[_a-z0-9]+')); 

/* 
Router::connect('/admin/:action/*', array('plugin' => 'admin', 'controller' => 'admin')); 
*/ 
Router::connect('/dash/:action/*', array('plugin' => 'admin', 'controller' => 'admin')); 

對不起。這是一個盲目的鏡頭。未經測試,但似乎是正確的做法。如果有人安裝了Admin插件可以驗證它會很好