私はCakephp 2.xに取り組んでいます...jsonのsomデータを使用してAndroidアプリに応答を返したい..ここに、私のcakephp Webで応答を取得する方法を示す関数があります..
public function phone(){
$this->loadModel('User');
if ($this->request->isPost()){
$json = $this->request->data('json');
$data = json_decode($json, TRUE);
if($data){
//here i want to send response back to mobile app
}
}
私はjson応答でこのように返したい..つまり、json応答で変数名とその値を送信したい
[Contact] => Array
(
[idContacts] => 1
[name] => asad
[mobileNo] => 03224999464