Thanks for the suggestion! We ended up taking a similar approach by
extending the HtmlHelper::url() function in the app_helper.php (based
on this article:
http://debuggable.com/posts/how-to-save-half-a-second-on-every-reques...
<?php
// app_helper.php
class AppHelper extends Helper {
function url($url = null, $full = false) {
if( !isset($url['plugin']) ){
$url['plugin'] = null;
}
return parent::url($url, $full);
}
}
?>
Now you just have to make sure that any plugin URLs have the plugin
explicitly defined in the url array ('plugin' => 'plugin_name'), but
all other links will have 'plugin' => null set by default.
On Nov 4, 8:49 pm, Robert P <shiftyrobs...@gmail.com> wrote:
> This seems to be an issue traceable back to Router::url(). A possible
> solution would be to extend the View class to override the renderLayout
> () method.
> The new renderLayout() would be something like:
> get Router instance
> removepluginreferences
> parent::renderLayout()
> I would be interested in hearing if this works.
> On Nov 5, 1:09 am, benr <benrasmu...@gmail.com> wrote:
> > I have apluginto handle a portion of my application. Theplugin
> > renders a view, but uses my default layout. The problem is that all my
> > links in the layout (which don't have anything to do with theplugin)
> > all get thepluginname prefixed to them. For example:
> > Regularlink:http://domain.com/regularlink
> > Inpluginview:http://domain.com/plugin_name/regularlink
> > I'm using $html->link() to create all my links and I know that you can
> > add 'plugin' => null to disable that routing behavior but it seems a
> > bit counter-intuitive to have to do that with every non-pluginlinkin
> > a layout just so you can use plugins.
> > Is there a way to set the baseUrl or somehow remove that prefix form
> > all links unless they explicitly have the 'plugin' => 'plugin_name'
> > key/value in the url array()?