Tuesday, October 27, 2009

$html->link HELP

Hi All,

I am fairly new to cake and just can't seem to get my head wrapped
around this.

I have made a simple FORUM plugin (placed in plugings folder) and have
placed this code is the routes.php file.

Router::connect('/forum', array('plugin' => 'forum', 'controller' =>
'forum_posts', 'action' => 'index'));

ALL GOOD. When I am in my root, I get to the forum.

I have a navigation element that I am using in my main app at:

cake/app/views/elements/navigation.ctp

When I am anywhere in my root my links work great.

As soon as I enter my forum plugin, my links suddenly go wacky and
lose their routing that I have specified.

In root - my home link: echo $html->link(__('HOME', true), array
('controller' => 'pages', 'action' => 'display', 'home'));
and in routes.php: Router::connect('/', array('controller' => 'pages',
'action' => 'display', 'home'));

alwasy maps to my home page - www.site.com.

As soon as I enter the forum, suddenly the link looks like this
(www.site.com/forum/pages/display/home) and I get a missing controller
error.

How can I get rid of the /forum/ part. Do I have to map all the the
links with /forum/ infront as well as regular?

I hope I have provided enough info and thanks in advance.

Brad

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: