ディレクトリ構成

CakePHPでは、ROOT/app/webrootのどの階層をドキュメントルートにしても動作するようになっていますが、セキュリティのためにはwebroot以上を公開層にしたほうがいいです。

app
│├ config 設定
││├ acl.ini.php
││├ bootstrap.php
││├ core.php
││├ database.php
││├ database.php.default
││├ inflections.php
││├ routes.php
││└ sql
││ ├ db_acl.php
││ ├ db_acl.sql
││ ├ i18n.php
││ ├ i18n.sql
││ ├ sessions.php
││ └ sessions.sql
│├ controllers コントローラ
││├ [コントローラ名]_controller.php
││└ components
│├ locale
│├ models モデル
││├ behaviors
││└ datasources
│├ plugins
│├ tests
││└ groups
│├ tmp 一時ファイル(これ以下の階層は書き込み可にする)
││├ cache
│││└ views
││├ logs
││├ sessions
││└ tests
│├ vendors
││└ shells
│├ views ビュー(テンプレート)
││├ elements
││├ errors
│││└ missing_controller.ctp
││├ helpers
││├ layouts
│││├ js
│││├ rss
│││└ xml
││├ pages
│││└ [コントローラ名]
│││ └ [アクション名].html
││└ scaffolds
│├ webroot セキュアな公開層
││├ css
│││└ cake.generic.css
││├ css.php
││├ favicon.ico
││├ files
││├ img
││├ .htaccess
││├ index.php
││├ js
│││└ vendors.php
││└ test.php
│├ .htaccess
│└ index.php
├ cake CakePHPのコア
│├ basics.php
│├ bootstrap.php
│├ config
│├ console
│├ dispatcher.php
│├ libs
│├ tests
││└ lib
│├ LICENSE.txt
│└ VERSION.txt
├ .htaccess
├ index.php
├ README
└ vendors
 ├ css
 ├ js
 └ shells

controller.phpは次のようになる。

<?php
class [コントローラ名(先頭1文字は大文字)]Controller extends AppController {
  
  function [アクション名]()
  {

  }
  
  function [アクション名]()
  {

  }
}
?>

関連記事

スポンサーリンク

border-colorの既定値とtransparent値に対応する色が#000000になっている

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る