Thanks for all the answers. I managed to get what I wanted this way:
'route' => '/booklist[/:action][/:id][/owner/:ownerid][/book/:bookid]' works fine :) 2013/8/2 Marco Pivetta [via Zend Framework Community] < [email protected]> > Note: The correct pattern to use is > '/booklist[/:action[/:id[/:ownerid[/:bookid]]]]', since otherwise the > route > does not know how to deal with parameter priorities when matching. > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > > On 1 August 2013 22:40, adriandro <[hidden > email]<http://user/SendEmail.jtp?type=node&node=4660664&i=0>> > wrote: > > > Hi everyone > > > > 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 > > > > > > > > -- > > View this message in context: > > > http://zend-framework-community.634137.n4.nabble.com/Routing-with-optional-params-tp4660656.html > > Sent from the Zend Framework mailing list archive at Nabble.com. > > > > -- > > List: [hidden email]<http://user/SendEmail.jtp?type=node&node=4660664&i=1> > > Info: http://framework.zend.com/archives > > Unsubscribe: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=4660664&i=2> > > > > > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://zend-framework-community.634137.n4.nabble.com/Routing-with-optional-params-tp4660656p4660664.html > To unsubscribe from Routing with optional params, click > here<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4660656&code=YWRyaWFuLmRyb3pkekBnbWFpbC5jb218NDY2MDY1NnwtMTc3MDA5OTExNQ==> > . > NAML<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- Pozdrawiam Adrian Dróżdż -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Routing-with-optional-params-tp4660656p4660694.html Sent from the Zend Framework mailing list archive at Nabble.com.
