i was completely lost until I find the solution for the "search" route 
because of your remark about the constraint of the id !

here is the the new "search" route :

'search' => array(
                 'type' => 'Segment',
                 'options' => array(
                     'route' => '/:type[/:location]',
                     'constraints' => array(
                         'type' => '[a-zA-Z][a-zA-Z0-9_-]*',
                         'location' => '[a-zA-Z0-9_-]*', ------> the 
precedent regex only accept string beginning with word and not with 
numbers, that's why the detail view was served instead of search view.
                     ),
                     'defaults' => array(
                         'controller' => 'RezFrontApp\Controller\Index',
                         'action' => 'search',
                     ),
                 ),
                 'may_terminate' => true,
                 'child_routes' => array(
                     'detail' => array(
                         'type' => 'Segment',
                         'options' => array(
                             'route' => '/:id',
                             'constraints' => array(
                                 'id' => '[0-9]+',
                             ),
                             'defaults' => array(
                                 'action' => 'detail',
                             ),
                         ),
                     ),
                 ),
             ),

Thank you sir, thanks a lot for your inspiring guidance ^^

Le 14/08/2013 20:30, Ravidhu Dissanayake a écrit :
> sorry i mistyped : mywebsite/one-type/one-location/*one**-id* , it is 
> an integer :/
>
>
> Le 14/08/2013 19:56, weierophinney [via Zend Framework Community] a 
> écrit :
>> On Wed, Aug 14, 2013 at 11:22 AM, ravidhu <[hidden email] 
>> </user/SendEmail.jtp?type=node&node=4660757&i=0>> wrote:
>> > thanks for your answer, so i test your config with the following url :
>> >
>> >  mywebsite -> work
>> >
>> >  mywebsite/ -> work
>> >
>> >  mywebsite/one-type -> work
>> >
>> >  mywebsite/one-type/one-location -> work but i get the detail view 
>> file
>>
>> You can fix that within the controller, by specifying the template in
>> the view model you return; if you're not returning a view model, do.
>>
>> >  mywebsite/one-type/one-location/on-id -> still don't work : "The 
>> requested
>> > URL could not be matched by routing."
>>
>> This makes sense -- the constraint regex you set for :id does not
>> include the "-" character; you specified "[0-9]+". If you want
>> alphabetical characters and hyphens, you'll need to add those to the
>> constraint: "[a-z0-9-]+"
>>
>> >  mywebsite/connexion ->work
>> >
>> >  mywebsite/confirm ->work
>>
>>
>>
>> -- 
>> Matthew Weier O'Phinney
>> Project Lead            | [hidden email] 
>> </user/SendEmail.jtp?type=node&node=4660757&i=1>
>> Zend Framework          | http://framework.zend.com/
>> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>>
>> -- 
>> List: [hidden email] </user/SendEmail.jtp?type=node&node=4660757&i=2>
>> Info: http://framework.zend.com/archives
>> Unsubscribe: [hidden email] 
>> </user/SendEmail.jtp?type=node&node=4660757&i=3>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>> If you reply to this email, your message will be added to the 
>> discussion below:
>> http://zend-framework-community.634137.n4.nabble.com/ZF2-matched-by-routing-tp4660753p4660757.html
>>  
>>
>> To start a new topic under Zend Framework, email 
>> [email protected]
>> To unsubscribe from ZF2, matched by routing, click here 
>> <http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4660753&code=cmF2aWRodS5kaXNzYUBnbWFpbC5jb218NDY2MDc1M3wtMTU1Mzk3NTE1NA==>.
>> 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>
>>  
>>
>





--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-matched-by-routing-tp4660753p4660759.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to