什么是 CakePHP 3 主页?我无法重定向到那个
What is CakePHP 3 home page? I can't redirect to that
我正在 CakePHP 3
中开发网页,但遇到了问题。
我在 "src/Template/Pages/home.ctp"
中有主页的视图,我在 PagesController.php
中创建了这个函数
public function home()
{ //code...
}
如果我去 URL 就可以进入这个页面: http://example.com/Pages/home but if I go to http://example.com/ I not go to this page. And if I go to http://example.com/pages/home 都不是。
我的错误是什么?我没看到!我想编辑"real"主页,我去http://example.com
时可以去哪里
在 config
文件夹中 routes.php
文件中:-
改变这个
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
到
$routes->connect('/', ['controller' => 'Pages', 'action' => 'home']);
我正在 CakePHP 3
中开发网页,但遇到了问题。
我在 "src/Template/Pages/home.ctp"
中有主页的视图,我在 PagesController.php
public function home()
{ //code...
}
如果我去 URL 就可以进入这个页面: http://example.com/Pages/home but if I go to http://example.com/ I not go to this page. And if I go to http://example.com/pages/home 都不是。
我的错误是什么?我没看到!我想编辑"real"主页,我去http://example.com
时可以去哪里在 config
文件夹中 routes.php
文件中:-
改变这个
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
到
$routes->connect('/', ['controller' => 'Pages', 'action' => 'home']);