Thursday, November 25, 2010

Re: Complex Router Connect

Thanks cricket,
For generate URLs it worked fine, but when i access the link i got a
error "Controller Sapatilhas not found".
Url:
http://localhost/bottero/sapatilhas/133901/compartilhar-via-email

I will post my routes.php
http://bin.cakephp.org/view/480208437

Any ideia?

Thx.

Att,
Daniel

On 25 nov, 01:14, cricket <zijn.digi...@gmail.com> wrote:
> On Wed, Nov 24, 2010 at 8:47 PM, Daniel <sphin...@gmail.com> wrote:
> > Well guys, i trying to setup this Router and i cant made it work,
>
> > Some1 have any ideia?
>
> > Code:
> >http://bin.cakephp.org/view/369700705
>
> > URL Should return:
> >http://www.domain.com/sapatilhas/1889900-verde/compartilhar-via-email
>
> You need to pass the keys for categoria-slug & modelo-slug.
>
> echo $html->link(
>         'E-mail',
>         array(
>                 'controller' => 'modelos',
>                 'action' => 'email',
>                 'categoria-slug' => 'sapatilhas',
>                 'modelo-slug' => '1889900-verde'
>         )
> );
>
> I changed the regexps, also. Although it's difficult to say what you
> need for categoria-slug, what you had didn't appear to make sense.
>
> Router::connect(
>         '/:categoria-slug/:modelo-slug/compartilhar-via-email',
>         array('controller' => 'modelos', 'action' => 'email'),
>         array(
>                 'categoria-slug' => '[a-z]+',
>                 'modelo-slug' => '[-a-z0-9]+'
>         )
> );
>
> That should work for the example URL but can you post more examples of
> what might be expected for categoria-slug? If it's not just straight
> letters the above will need to be modified.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

No comments: