On Mon, Mar 21, 2011 at 7:14 AM, AD7six <[email protected]> wrote:
>
>
> On Mar 20, 9:44 pm, cricket <[email protected]> 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 found Router's interpretation:

CakeRoute Object
(
        [keys] => Array
                (
                        [0] => slug
                )

        [options] => Array
                (
                        [slug] => bio
                        [pass] => Array
                                (
                                        [0] => slug
                                )

                )

        [defaults] => Array
                (
                        [admin] => 0
                        [controller] => pages
                        [action] => display
                        [prefix] => admin
                        [plugin] =>
                )

        [template] => /:slug
        [_greedy] =>
        [_compiledRoute] => #^(?:/(bio))[/]*$#
        [__headerMap] => Array
                (
                        [type] => content_type
                        [method] => request_method
                        [server] => server_name
                )

)

The problem seems to be the prefix. So I changed it to:


Router::connect(
        '/:slug',
        array(
                'admin' => 0,
                'prefix' => null,
                'controller' => 'pages',
                'action' => 'display'
        ),
        array(
                'slug' => 'bio',  // not a regexp issue
                'pass' => array('slug')
        )
);

echo $this->Html->link(
        'foo',
        array(
                'admin' => 0,
                'prefix' => null,
                'controller' => 'pages',
                'action' => 'display',
                'slug' => 'bio'
        )
);

This still isn't matching. What is the appropriate way to create
routes--and links to match them--that should never include an admin
prefix?

I feel like suddenly everything I thought I knew about routes is wrong.

-- 
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