25
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CakePHPでデフォルトページの設定

Posted at

初期状態でトップページにアクセスした時に表示されるページ。
/lib/Cake/View/Pages/home.ctp

この設定箇所は、/app/config/routes.php の下記の記述。
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));

この設定を任意のページに変更すれば表示画面が変わる。

また、ビューとレイアウトを変更するのはチェックページにもあるように、
以下の方法でも可能。

1.app/View/Pages/ に home.ctp を作って設置。
(To change the content of this page, create: APP/View/Pages/home.ctp.)
※ページ内のコンテンツ

2.app/View/Layouts/ に default.ctp を作って設置。
(To change its layout, create: APP/View/Layouts/default.ctp.)
※ヘッダーとフッターの部分

はじめてCakePHP使った時に少し迷ったので共有します。

25
24
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?