LoginSignup
4
4

More than 5 years have passed since last update.

CakePHP メモ

Last updated at Posted at 2015-03-18

file_get_contentsより早い

App::uses('HttpSocket', 'Network/Http');
class hogeComponent extends Component {
    function hogehoge($url, $query) {
        $sock = new HttpSocket();
        $res   = $sock->get($url, $query);
        return $res['body'];
    }
}

定数

Cakephp公式

リクエストパラメータ

実行中コントローラー名の取得

$this->name

実行中アクション名の取得

$this->action

POST値取得

$this->request->data

GET値取得

$this->request->query

コントローラ名以下のURLを配列で取得

$this->request->pass

マイグレーション

スキーマテーブル作成

app/Console/cake Schema create

テーブル内容を手動で変更後、マイグレーションへ反映

app/Console/cake Migrations.migration generate -f

スキーマファイルに従い更新

app/Console/cake Schema update
4
4
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
4
4