Re: route being ignored
On Mar 20, 9:44 pm, cricket <zijn.digi...@gmail.com> wrote:
> Using 1.3.7
>
> Some of my routes are apparently being ignored.
Routes don't get ignored, they simply don't match and are skipped.
>I've simplified things
> as much as possible, including putting the following (unrealistic)
> route at the top of router.php.
>
> router.php:
> Router::connect(
> '/:slug',
> array(
> 'admin' => 0,
> 'controller' => 'pages',
> 'action' => 'display'
> ),
> array(
> 'slug' => 'bio',
> 'pass' => array('slug')
> )
> );
>
> some view:
> echo $this->Html->link(
> 'foo',
> array(
> 'admin' => 0,
> 'controller' => 'pages',
> 'action' => 'display',
> 'slug' => 'bio'
> ),
> array('title' => 'wtf?')
> );
>
> expected url: "/bio"
> result: "/pages/display/slug:bio"
what's a real/unsimplified example of what you're trying to do?
If your real example is for pages (?) why not simply use a url. /foo -
it's a lot simpler that way you _know_ what you want it's not really
dependent on routes at all, and it's faster.
>
> Normally, the array would have 'slug' => 'bio|about|contact' but I've
> simplified it here to rule out any issues with the regexp.
>
> The crazy thing is not only that I've done this before but that it was
> working earlier for this particular site. It's still in development
> and I haven't any idea at what point things went bad. I figure it must
> be something really simple but whatever it is it's been eluding me.
check your routes are actually loaded - put debug statements in the
Router class, for example. or checkout a previous version of your app
and determine where things went south (git bisect).
AD
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home