Zend framework 2 dynamic routing -


i want write routes type of urls

http://www.example.com/category/sub-category/id.html 

here category dynamic. means- have 100 of categories in db. sub category dynamic. need show page based on id value. 1 please suggest.

try reading docs first simple :

'sample' => array(                 'type' => 'segment',                 'options' => array(                     'route' => '/:category[/:sub_category[/:id]].html',                     'defaults' => array(                         'controller' => 'your controller',                         'action' => 'your action',                     ),                 ),             ), 

with router config can have :

http://www.example.com/category.html http://www.example.com/category/sub-category.html http://www.example.com/category/sub-category/id.html 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -