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