On Tue, Mar 22, 2011 at 6:44 AM, AD7six <[email protected]> wrote:
>
> You're mixing things up, where you are in your app is contextually
> relevant - the prefix (and the admin key) if you don't change it
> persists from whatever the value is for the current request. You're
> apparently testing from an /admin/ url. You need to set admin and
> prefix to false for the route to match - try (reading) the router test
> case if you're still fuzzy.

I realise that. I never want these links to have an admin prefix,
regardless of the user status or what page they're displayed on. This
is why I had 'admin' => 0 in the link() call. Precisely how I've
always done this.

The problem was that I also had 'admin' => 0 in the route itself. When
I remove that, all works fine. Why that is isn't at all clear to me.


> However, again: why use routes at all for absolutely static routes.
> You want the url /foo you can type /foo, but instead are typing
>  array('plugin' => false, 'prefix' => false, 'admin' => false,
> 'controller' => 'pages', 'action' => 'display', 'slug' => 'foo')

I'm not typing anything. The actual code prints the links from a loop.
The data is from the DB. The route array is unserialised. Had I
included al of that it would have got in the way of understanding
where my problem was. Better for me to create a simplified test case,
no? I thought it was clear that my example was contrived (although
tested literally).

-- 
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to