Table of Contents : マニュアル
- 1 CakePHPの基本原則
- 2 CakePHPによる開発
- 2.1 必要なもの
- 2.2 インストールの準備
- 2.3 インストール
- 2.4 環境設定
- 2.5 Controllers
- 2.5.1 Introduction
- 2.5.2 Controller Attributes
- 2.5.3 Controller Methods
- 2.6 Components
- 2.7 Models
- 2.7.1 Introduction
- 2.7.2 Automagic Model Fields
- 2.7.3 Model Attributes
- 2.7.4 Model Methods
- 2.7.5 Associations
- 2.7.6 DataSources
- 2.7.7 Behaviors
- 2.8 Views
- 2.9 Helpers
- 2.10 Scaffolding
- 2.11 The CakePHP Console
- 2.12 Code Generation with Bake
- 2.13 Plugins
- 2.14 Global Constants and Functions
- 3 Common Tasks With CakePHP
- 3.1 Data Validation
- 3.1.1 Simple Rules
- 3.1.2 One Rule Per Field
- 3.1.3 Multiple Rules per Field
- 3.1.4 Built-in Validation Rules
- 3.1.4.1 alphaNumeric
- 3.1.4.2 between
- 3.1.4.3 blank
- 3.1.4.4 cc
- 3.1.4.5 comparison
- 3.1.4.6 date
- 3.1.4.7 decimal
- 3.1.4.8 email
- 3.1.4.9 equalTo
- 3.1.4.10 extension
- 3.1.4.11 file
- 3.1.4.12 ip
- 3.1.4.13 isUnique
- 3.1.4.14 minLength
- 3.1.4.15 maxLength
- 3.1.4.16 money
- 3.1.4.17 multiple
- 3.1.4.18 numeric
- 3.1.4.19 phone
- 3.1.4.20 postal
- 3.1.4.21 range
- 3.1.4.22 ssn
- 3.1.4.23 url
- 3.1.5 Custom Validation Rules
- 3.1.6 Validating Data from the Controller
- 3.2 Data Sanitization
- 3.3 Error Handling
- 3.4 Debugging
- 3.5 Caching
- 3.6 Logging
- 3.7 Testing
- 3.8 Localization & Internationalization
- 3.9 Pagination
- 3.1 Data Validation
- 4 組み込みのコンポーネント
- 4.1 Access Control Lists
- 4.2 Authentication
- 4.3 Sessions
- 4.4 Benefits
- Responding To Requests
- 4.6 Basic HTTP Authentication
- 4.7 Controller
- 6 組み込みのヘルパー
- 6.1 フォーム
- 6.1.1 フォームの作成
- 6.1.2 フォームの終了
- 6.1.3 Closing the Form
- 6.1.3.1 Automagic Form Elements
- 6.1.3.2 $options[‘type’]
- 6.1.3.3 $options[‘before’], $options[‘between’] and $options[‘after’]
- 6.1.3.4 $options[‘options’]
- 6.1.3.5 $options[‘multiple’]
- 6.1.3.6 $options[‘maxLength’]
- 6.1.3.7 $options[‘div’]
- 6.1.3.8 $options[‘label’]
- 6.1.3.9 $options[‘id’]
- 6.1.3.10 $options[‘error’]
- 6.1.3.11 $options[‘selected’]
- 6.1.3.12 $options[‘rows’], $options[‘cols’]
- 6.1.3.13 $options[‘empty’]
- 6.1.3.14 $options[‘timeFormat’]
- 6.1.4 $options[‘dateFormat’]
- 6.1.5 File Fields
- 6.2 Form Element-Specific Methods
- 6.3 XML
- 6.4 Inserting Well-Formatted elements
- 6.5 Methods
- 6.6 Methods
- 6.7 Clearing the Cache
- 6.8 Form
- 6.9 format
- 6.10 Text
- 6.1 フォーム
- 7 Testing Time
- 8 CakePHPブログチュートリアル
- 9 Conclusion
- 10 Simple User Authentication
アプリケーションの拡張
コントローラ、ヘルパー、モデルには親クラスがあり、アプリケーション全体に変更を加えることができます。AppController (/app/app_controller.phpの位置に置きます。)と、AppModel (/app/app_model.phpの位置に置きます。)は、すべてのコントローラ、ヘルパー、モデルで共有するようなメソッドを置くのに良い場所です。
クラスやファイルではありませんが、routesは、CakePHPにリクエストを送る役割を果たしています。Routeを定義することによって、URLとコントローラのアクションをどのように結びつける(map)かがCakePHPに伝えられます。URL “/controller/action/var1/var2”は、デフォルトの動作では、Controller::action($var1, $var2)にマップされます。しかし、routesを使うとURLをカスタマイズでき、アプリケーション内でどのように解釈するかを設定できます。
アプリケーション内の機能の中には、そっくりそのままパッケージ化してしまうと便利なものもあります。プラグイン(plugin)はモデル、コントローラ、ビューをパッケージ化したもので、ある特定の目的のために複数のアプリケーションで使えるようにしたものです。ユーザ管理システムや簡単なブログシステムなどを、CakePHPのプラグインにできるでしょう。

login to add a comment