Tuesday, August 31, 2010

Re: Router::connect() not behaving as expected in 1.3?

To explain a bit why the extra route is needed. The Router in 1.2 did
a lot of black magic, guessing at what you meant instead of just doing
what you typed. This incurred a ton of overhead as it had to attempt
several different guesses at what might work for each route. Most of
the guesswork was removed in 1.3 giving a big performance boost in the
router. So while its a bit of a pain to have to include two routes,
which I can understand I think the performance benefit and the
additional explicitness the routes now have was worth it.

-Mark

On Aug 25, 6:05 am, SacoDesign <sign...@sacodesign.com> 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 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: