Creating meaningful add URLs in Cakephp

Posted by Loftx on Stack Overflow See other posts from Stack Overflow or by Loftx
Published on 2010-05-19T09:08:23Z Indexed on 2010/05/19 9:10 UTC
Read the original article Hit count: 644

Filed under:
|
|
|

Hi there,

For my site I have a number of Orders each of which contains a number of Quotes. A quote is always tied to an individual order, so in the quotes controller I add a quote with reference to it's order:

function add($orderId) {
    // funtion here
}

And the calling URL looks a bit like

http://www.example.com/quotes/add/1

It occurred to me the URLs would make more sense if they looked a bit more like

http://www.example.com/orders/1/quotes/add

As the quote is being added to order 1.

Is this something it's possible to achive in CakePHP?

Cheers,

Tom

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about url-routing