I did it in the following way:

Router::connect('/video/:artistName/:videoTitle/', array('controller' =>
'videos', 'action' => 'searchByName'));

Then...

        function searchByName(){
            $Conditions = array(    'Video.urlName' =>
$this->params['videoTitle'],
                                    'Artist.urlName' =>
$this->params['artistName']    );

Then...

            $Video = $this->Video->find($Conditions, array(),'', 2);

// Redirect if no found
            if(!$Video){    $this->redirect('/');    }

// Show'em what they want
            $this->set('Video', $Video);


Salut mes amis!

On Wed, Jun 18, 2008 at 4:40 PM, Novice Programmer <[EMAIL PROTECTED]>
wrote:

> Hello,
>
> I want to map http://<website_name>/comments/<file_name>/1 to 
> http://<website_name>/comments/<file_id>/1.
> Any hints on how to do this with routes?
>
> --
> Thanks & Regards,
> Novice.
> >
>


-- 
Nicolás Andrade
www.nicoandra.com.ar
www.treintaguita.com.ar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

  • Routing rules Novice Programmer
    • Re: Routing rules Nicolás Andrade

Reply via email to