ROUTER for friendly URL

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

ROUTER for friendly URL

Marco Garcia
Redid a website for a client in Cake 2.X and the current site (made native in PHP) has a BD with friendly URLs, something like: city/typestore/name-of-shop. Obviously the HTACCESS is set to receive and treat URLs and "play" the content accordingly.

In the new application (in CakePHP) what I did was this: stores/show/123. Those who understand Cake know it's the controller/action/parameter. The 123 is the ID that step as a parameter.

In the table of the site I have some columns as friendly Url and shop ID (in the example above would be 123)

How can I link these two information, ie, accessing the friendly URL I play ROUTE in the controller, action, and parameter (ID) correctly, pulling the BD (for ID only)?

NOTE 1: It is noteworthy that the new application does NOT have direct access to the database. It's all Web service/API. I have a method layout where I send the URL and it returns ID. Send ID return URL. I also have the programmer's API willingness to create what it takes to succeed.

NOTE 2: The call to the store have to be stores/show/SHOP_ID

Can someone help me?

Like Us on FaceBook
Find us on Twitter

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at
For more options, visit