CakePHP可搜索的Neil Crookes插件

时间:2010-07-18 08:26:29

标签: search cakephp full-text-search cakephp-1.3

使用Neil Crookes的Searchable Plugin时,我遇到了路由问题。当我搜索某些内容时,网址如下所示: http://localhost/search/All/sunshine

但是现在所有其他链接的URL都有插件的名称。 例如: $ html-> link(__('News',true),array('controller'=>'news','action'=>'index')); 创建此链接网址: http://localhost/searchable/news 正确为 http://localhost/news

我已经在app / config / routes.php中找到了这个:

Router::connect('/search/:type/:term/*', array(
  'plugin' => 'searchable',
  'controller' => 'search_indexes',
  'action' => 'index',
));

任何想法我如何摆脱“/ searchable /”为我的正常应用程序链接???

1 个答案:

答案 0 :(得分:1)

对于Cake链接助手创建的普通链接,您必须添加此参数'plugin'=>空

示例:

$html->link(__('News', true), array('controller'=>'news', 'action'=>'index', 'plugin' => null));