cakephp 3.0 - Cakephp3 Routes, no action name in url -
i wanted ask, hou create route in cakephp3, want no action name in url.
now have localhost/pages/contact , want localhost/contact.
my link looks like:
echo $this->html->link(__('kontakt'), ['controller' => 'pages', 'action' => 'contakt']);
i have created route:
$routes->connect('/pages/:action/', ['controller' => 'pages']);
this doesnt work, link have pages controller in content.
thanks reply.
$routes->connect('/contact', ['controller' => 'pages', 'action' => 'contact']);
and view:
echo $this->html->link(__('kontakt'), 'contact');
Comments
Post a Comment