How Plugin routes work!

Hi everyone,

I am creating a plugin in cakephp 3. I enabled the routes while loading the plugin. Currently I am not using any plusin layout, just rendering the templates on the parent layout of the site. I am experiencing problem with the plugin routes and links created with Url Helper Builder method or HtmlHelper. When i create links with either one of them in my main site, (not in the plugin) , when visiting the plugin url i.e. http://mysite.local/doc-manager/, the home link created in the site using
$this->Html->Link(‘Home’ , [‘controller’=>‘Home’,‘action’=>‘index’]) results in http://mysite.local/doc-manager/, while it should link to home i.e. / . I did not find any solution related to this so far even after googling it.

Any help will be much appreciated.

Regards,

Sajid

You have to explicitly pass ‘plugin => false’. Something like
$this->Html->Link(‘Home’ , [‘controller’=>‘Home’,‘action’=>‘index’, ‘plugin’ => false]);

Thanks aavrug,

I already found that out though, But i think this should be the default behaviour of link or any other router::url methods.

So that this would not affect already built application without ‘plugin’=>false parameter.

Sajid