cakephp2.doc_020
R e i - D r e a m
for Laravel
TOP > CakePHP2 > CakePHP2 Component関連
Guest
login

最終投稿日:2019年11月20日

目次
○ CakePHP Component関連
[Component]の基本
Auth認証
認証画面設定方法
Security
不正遷移制御
メール送信
[メール送信]サンプル紹介
Component関連(基本)
CakePHP2.x
ファイル名はキャメル形式+「Component.php」
例)
    MytestComponent.php

<?php
//「extends Object」から「extends Component」へ変更
class MytestComponent extends Component {

    //CakePHP2.3 以降は JAVA っぽく書くみたい。
    public function initialize(Controller $controller) {
        $this->controller = $controller;
    }
    //上記初期設定で「controller」にアクセスできる

    ※$this->controller->name で、このコンポーネントを処理している「controller」名が取得できる
            
ログインしてコメントを残そう!!


きっぷる