For smart Primates & ROBOTS (oh and ALIENS ).

Friday, April 03, 2015

How to change default controller in CakePHP 3.0

Problem:

How to change default controller in CakePHP 3.0. You know that default page of CakePHP 3.0 is Pages and it's action is display.

Solution:

To change default controller in CakePHP 3.0 open config.php which is located under "config" folder.
and change :

$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
TO
$routes->connect('/', ['controller' => 'Welcome', 'action' => 'index', 'home']);

Where Welcome is your created controller.

Share:

0 comments:

Post a Comment

Featured Post

Core Web Vitals Assessment showing LCP 10.6s while google pagespeed report showing LCP 3.5s why?

Core Web Vitals Assessment showing LCP 10.6s while google pagespeed report showing LCP 3.5s why? So, you can face this situation while...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive