If you have pages in a subdirectory you can also use a wildcard to
avoid having to list a route for each one:

Router::connect('/about', array('controller' => 'pages', 'action' =>
'display', 'about/index'));
Router::connect('/about/*', array('controller' => 'pages', 'action' =>
'display', 'about'));


On Mon, May 5, 2008 at 10:42 AM, basstech <[EMAIL PROTECTED]> wrote:
>
>  Thank you, that's what I was looking for.
>
>  On May 5, 4:01 am, "[EMAIL PROTECTED]"
>
>
> <[EMAIL PROTECTED]> wrote:
>  > The easiest way is to add some extra routes in the app/config/
>  > routes.php
>  >
>  > In cake 1.2:
>  > Router::connect('/about', array('controller' => 'pages', 'action' =>
>  > 'display', 'about'));
>  >
>  > In cake 1.1
>  > $Route->connect('/about', array('controller' => 'pages', 'action' =>
>  > 'display', 'about'));
>  >
>  > On May 5, 7:03 am, basstech <[EMAIL PROTECTED]> wrote:
>  >
>  > > Is there an easy way to configure my CakePHP app to construct URLs
>  > > without the "pages/" part in it?
>  >
>  > > For example, if I use the HtmlHelper like so:
>  >
>  > > $html->link('About Me', 'about', null, false, false);
>  >
>  > > Right now, CakePHP constructs the URL "http://domain.name/pages/
>  > > about/". I would like this behavior to instead construct the URL
>  > > "http://domain.name/about/";. Is there an easy way to do accomplish
>  > > this?
>  >
>  > > I know that there is a workaround to this by making an "AboutModel"
>  > > and "AboutController" that could respond to this, however I would like
>  > > to use the built in PagesController functionality rather than write a
>  > > new MVC for each page.
>  >
>  > > Thanks
>  > > CJ
>  >
>

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

Reply via email to