On Thu, Aug 1, 2013 at 3:40 PM, adriandro <[email protected]> wrote:
> I have typical segment routes to be able to implement CRUD operations for
> examlpe
>
> route' => '/booklist[/:action][/:id]
>
> which (booklist) consists of owners, books and some other stuff everything
> works great but now I want to change it a bit.
>
> I have a form for adding new records to db which consists mainly of two
> select fields ownerid and bookid which are list of all books and owners in
> db.
>
> I want to be able to pass ownerid or bookid to the form through route so
> that form automatically sets value to corresponding select fields.
> Unfortunately this route
>
> 'route' => '/booklist[/:action[/:id][/:ownerid][/:bookid]]'
>
> gets me nowhere. if I write $this->url('booklist', array('action' => 'add',
> 'ownerid' => somevalue) it puts this somevalue to id not ownerid
>
> How should i create routes withou creating route for every single crud
> operations

This is a perfectly acceptable use case for query parameters, in my
opinion. Such links are not intended for SEO purposes, as they
describe operations, and don't need to be in the URL path.


-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to