简体   繁体   中英

CakePHP Searchable Plugin of Neil Crookes

I have a problem with the routing while using the Searchable Plugin of Neil Crookes. When I search for something the URL looks like this: http://localhost/search/All/sunshine

But now all the other links have the name of the plugin in their URL. For example this: $html->link(__('News', true), array('controller'=>'news', 'action'=>'index')); creates this link url: http://localhost/searchable/news correct would be http://localhost/news

I already have this in app/config/routes.php:

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

Any idea how I can get rid of "/searchable/" for my normal app links???

For your normal links created by the Cake link helper you have to add this parameter 'plugin' => null

Example:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM