Posted on 18/3/06 by Felix Geisendörfer
The authors of this post have marked it as deprecated. This means the information displayed is most likely outdated, inaccurate, boring or a combination of all three.
Policy: We never delete deprecated posts, but they are not listed in our categories or show up in the search anymore.
Update: The problem was solved shortly after it appeared by updating to the latest version. So this should only be interesting to you if you are forced to run an older version of the core for some reasons.
If you have worked with cakephp plugins so far you might have notices this little problem: If you use the html helpers link() function to create your navigation menu in your layout the path will change if you call a plugin controller. The reason is that $this->base becomes base_url/plugin instead of the default base_url.
I have talked with PhpNut_ about it but haven't heard anything about it since then. So for those who need to work around the problem this will do it for now:
* This overwrites View::renderLayout in order to make the base path consistent for the layouts
* @param string $content_for_layout
* @return string
$dispatcher =& new Dispatcher();
$pluginBase = $this->base;
$defaultBase = $dispatcher->baseUrl();
$rtrn = parent::renderLayout($content_for_layout);
* This changes recursivley the base path of any given object/array
* @param mixed $object
* @param string $base
function __changeBase(&$object, $base)
foreach ($object as $id => $subObject)
$object->base = $base;
You can skip to the end and add a comment.
This post is too old. We do not allow comments here anymore in order to fight spam. If you have real feedback or questions for the post, please contact us.