Help us understand the problem. What is going on with this article?

CakePHP メモ

More than 5 years have passed since last update.

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
terumichi1209
WEBエンジニアです!
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away