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