Thanks AD7Six

My understanding was if I set something like:
Router::connect('/:action/', array('controller' => 'pages', 'action'
=> 'view'));
and any links like /about/
will be parsed as action name (since I used :action in the route)


I think the correct way to do is to add this as the last rule:
Router::connect('/*', array('controller' => 'pages', 'action'  =>
'view'));

Thanks

R


On Feb 6, 2:39 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Feb 6, 9:15 am, sabkaraja <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
>
> > I have religously followed the routing examples by the masters. But I
> > am not sure how and why its not working for me:
>
> > controllers users and admin which work fine.
>
> > #default action for users
> > Router::connect('/users/', array('controller' => 'users', 'action' =>
> > 'login'));
> > #default action for admin
> > Router::connect('/admin/', array('controller' => admin', 'action' =>
> > 'login'));
>
> > #some static pages need to be rerouted to /pages/view/param 
> > (eg:http://website.com/about)
> > Router::connect('/:action/', array('controller' => 'pages', 'action'
> > => 'view'));
>
> > #default action for / access
> > Router::connect('/', array('controller' => 'pages', 'action' =>
> > 'index', 'home'));
>
> > However I get this error:
>
> > Missing Method in PagesController
> > Error: The action about is not defined in controller PagesController
> > Error: Create PagesController::about() in file: app\controllers
> > \pages_controller.php.
>
> Your route explicitly states that /pages/x means look for the function
> x in the pages controller, what you want (it seems) is a route for /*
>
> Note that named parameters are not passed as arguments to functions.
>
> hth,
>
> AD- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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