$config = array(
'best-url' => array(
'pattern' => '/best',
'paths' => array(
'controller' => 'cate',
'action' => 'index?cate_id=1',
),
),
'better-url' => array(
'pattern' => '/better',
'paths' => array(
'controller' => 'cate',
'action' => 'index?cate_id=2',
),
),
'cate-url' => array(
'pattern' => '/cate/index/:int',
'paths' => array(
'controller' => 'cate',
'action' => 'index',
'cate_id' => '1'
),
)
);
I have a requirement that ,the url map to the cate_id like /best -> /cate/index?cate_id=1,/better -> /cate/index?cate_id = 2,I don't know how to config my routes,I had solve it above,but I need it auto reverse routing when I use $url->get('for'=>'cate-url','cate_id'=>1) it can not create the url like /best or /better. How can I solve it, thanks.