4
作为标题,如何在不将home.ctp放置在apps/views/pages /文件夹中的情况下更改默认视图?CakePHP:更改默认视图,而不是home.ctp
可以说,我想让默认主页显示/views/other/index.ctp。
我应该在哪里更改编码?它涉及哪些文件? 谢谢。
作为标题,如何在不将home.ctp放置在apps/views/pages /文件夹中的情况下更改默认视图?CakePHP:更改默认视图,而不是home.ctp
可以说,我想让默认主页显示/views/other/index.ctp。
我应该在哪里更改编码?它涉及哪些文件? 谢谢。
创建OtherController
:
// app/controllers/other_controller.php
class OtherController extends AppController {
public function index() {
// do something
}
}
和指向app/config/routes.php
根路由到它:
Router::connect('/', array('controller' => 'other', 'action' => 'index'));
http://stackoverflow.com/questions/34337525/cakephp-static-pages-without -entity,但与 - 动态内容 – Ricardo 2015-12-18 10:58:19