LoginSignup
1
1

More than 3 years have passed since last update.

cake php サーバーサイドからのデータの受け取りと振る舞い

Posted at

フロントサイドの経験があまりなく
初歩的なことに躓くこともあり、備忘録として記載

サーバー → フロント

ajaxの場合は

$this->response->data

レスポンスにいれた値が返せます

ajaxでない場合

$this->request->data

しかもcakeの機能を使用してフォームを作成している場合

$this->request->data['search']['item1']
$('data[search][item1]')

みたいに連想配列の形にしておけば、そのまま値が反映される

便利ですね。

また、フロントからの情報も機会があれば書きたいと思います。

1
1
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
1
1