That all looks correct, and it would be the same in 1.2. You might
write the following, though:
Router::connect('/blog*', array('controller' => 'news_articles'));
That would push all requests for the /blog directory to the right
controller, then you can create the actions you want and they'll get
filled in automatically since you didn't specify a pseudo-route for
each one (which might get complicated).
Cricket's right, though: by putting the pseudo route :action in there
and then assigning the action 'index,' you're basically pushing every
single request with a second (but no third) subdirectory in the URL to
the same action. Seems like it's a bit inefficient?
On Aug 25, 9:05 am, SacoDesign <[email protected]> wrote:
> Hello,
>
> I'm upgrading my app from 1.2 to 1.3. I have several custom routes
> setup like so:
> Router::connect('/blog/:action/*',
> array('controller'=>'news_articles', 'action'=>'index'));
>
> This works fine, except for when the url is only /blog/. In that case
> I get a "cannot find blog controller" error. Is this by design, or a
> bug?
>
> I can get it working by adding another route for:
>
> Router::connect('/blog', array('controller'=>'news_articles',
> 'action'=>'index'));
>
> but that seems wrong.
>
> Thanks,
>
> -Kevin Wentworth
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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