Thanks for your help,

The first ::connect (/cat/:category/) works fine, but the second one
for  /feed still doesn't work.

If I try to access /cat/category_name/index.rss I get an error, maybe
that's the reason why /feed isn't working. However I can access it if
I change the first ::connect to (/cat/:category/*)  but still nothing
for /feed

Any idea?

Thanks

On 21 mar, 11:58, brian <bally.z...@gmail.com> wrote:
> On Fri, Mar 20, 2009 at 11:58 PM, rod <rodrigo.z...@gmail.com> wrote:
>
> > Hi,
>
> > I need help with routes.php, I've read the documentation and many
> > blogs, articles but I still can't figure out how to do this:
>
> >http://localhost/cat/categoryAlias/feed
>
> > I have this which works fine:
>
> >Router::connect(
> >        '/cat/:category',
> >        array('controller' => 'categories', 'action' => 'index'),
> >        array('category' => '(.*)')
> > );
>
> > But then I'd like to have, for example:http://localhost/cat/Food/feed
> > - and that would point to Food/index.rss, however it doesn't work,
> > probably due to (.*) in the previousRouter::connect.
>
> You should tighten up the regexp a bit. Something like [-A-Za-z]+ or
> [_A-Za-z]+ or thereabouts. It'll obviously depend on whatever rules
> you have for creating your :category (slug)
>
> Router::connect(
>         '/cat/:category',
>         array('controller' => 'categories', 'action' => 'index'),
>         array(
>                 'category' => '[-_A-Za-z]+',
>                 'pass' => array('category')
>         )
> );
>
> Router::connect(
>         '/cat/:category/feed',
>         array(
>                 'controller' => 'categories',
>                 'action' => 'index',
>                 'ext' => 'rss'
>         ),
>         array(
>                 'category' => '[-_A-Za-z]+',
>                 'pass' => array('category')
>         )
> );
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to