ok this is driving me nuts now. basically if i put an underscore after
the parameter e.x :slug_
cake is expecting to find a match on 'slug_' not 'slug' as i want. if
i put an underscore before slug ex _:slug it works fine.
it appears underscore doesn't work as a variable delimiter.

On Aug 6, 2:03 pm, JamesF <[email protected]> wrote:
> @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 theregexparsed.
>
> 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 <[email protected]> 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<[email protected]> 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" <[email protected]> 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 <[email protected]> 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 theregex
> > >> > wasn't specific enough. i have admittley weakregexskills 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to