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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

javascript - How to process users in one specific order using map o each function? -

javascript - Linking from page A to a specific iframe on page B -