On Thu, Apr 7, 2011 at 7:53 AM, meekamoo <[email protected]> wrote:
> Hey all,
>
> I have a redirect set up that uses this array:
>
> Array
> (
>    [country] => za
>    [action] => listing
>    [0] => south-africa
> )
>
> That works and it correctly redirects to /za/properties/listing/south-
> africa
>
> As soon as I try to add a named parameter to the mix, the redirect
> ignores every extra parameter.
>
> Array
> (
>    [country] => za
>    [action] => listing
>    [0] => south-africa
>    [sale] => 1
> )
>
> Redirects to /za/properties/listing without ANY parameters.
>
> Anyone know what's going on here?

You should create a route. And why pass the country name if you
already have the ISO code in the URL?

Router::connect(
        '/properties/:country',
        array(
                'controller' => 'properties',
                'action' => 'listing'
        ),
        array(
                'country' => '[a-z]{2}',
                'pass' => array('country')
        )
);

public function listing($country = null) {}

I didn't include sale here because it's not clear to me what that
param is for. There may be a better way to approach this than just
passing 1 as a param.

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