@brian

yes in that attempt i was trying to see how the router was parsing
underscores, in the first example slug was 'slug' and the route
was /:slug_:sid/
in the last example i was curious to try slug as 'slug_', with the
route as /:slug__:sid/ to see how the regex parsed.

basically whenever i put another character like ) or - before the
underscore of the next parameter, (or after the first, im not sure of
how its parsing)
like this:
/:slug-_:sid/

i get what i want. /my-slug-is-so-great-except-for-the-last-dash-_sid/

trust me if it were up to me i would ditch the underscore altogether
for : like /slug:sid



On Aug 6, 12:28 pm, brian <bally.z...@gmail.com> wrote:
> You've got 2 underscores here:
>  '/:slug__:sid/*'
>
> If it was up to me, I'd just drop the underscores altogether. Just
> append sid to slug.
>
>
>
> On Thu, Aug 6, 2009 at 11:36 AM, JamesF<usaexportexpe...@gmail.com> wrote:
>
> > i even tried this thinking i was clever
>
> > Router::connect(
> >    '/:slug__:sid/*',
> >    array('controller' => mycontroller, 'action' => 'index'),
> >    array(
> >        'pass'=>array('sid', 'slug_'),
> >        'sid'=>'[0-9]+',
> >        'slug_'=>'[0-9a-z-]+',
> >    )
> > );
>
> > which gave me mysite.com/mycontroller/index/sid:12345/slug_:this-is-my-
> > slug
>
> > On Aug 6, 5:13 am, "Dr. Loboto" <drlob...@gmail.com> wrote:
> >> Router::connect(
> >>     '/:slug_:sid/*',
> >>     array('controller' => mycontroller, 'action' => 'index'),
> >>     array(
> >>         'pass'=>array('sid', 'slug'),
> >>         'sid'=>'[0-9]+',
> >>         'slug'=>'[0-9a-z-]+',
> >>     )
> >> );
>
> >> On Aug 6, 2:29 am, JamesF <usaexportexpe...@gmail.com> wrote:
>
> >> > for some reason when i am putting an underscore directly after a named
> >> > argument in my route, it breaks.
>
> >> > doesn't work:
> >> > Router::connect('/:slug_:sid/*', array('controller' => mycontroller,
> >> > 'action' => 'index'), array('pass'=>array('sid', 'slug'),
> >> > 'sid'=>'[0-9]+'));
>
> >> > if i put a dash or any other character right after my first argument
> >> > it works ok but that is not my desired url.
> >> > i would like /slug_sid/*
>
> >> > (my slug is something like my-article-title)
>
> >> > works:
> >> > Router::connect('/:slug-_:sid/*', array('controller' => mycontroller,
> >> > 'action' => 'index'), array('pass'=>array('sid', 'slug'),
> >> > 'sid'=>'[0-9]+'));
>
> >> > i saw a bug report about this but nate closed it saying that the regex
> >> > wasn't specific enough. i have admittley weak regex skills does anyone
> >> > kow a possible solution?
>
> >> > thanks- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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