Android ソースコード
Web側(Cakephp : Jsonコードを出力)
public function index2($name = 'j13000') {
$this->Point->recursive = 0;
//if (!is_null($name)) {
$this->paginate = array(
'conditions'=>array(
'name' => $name
),
'order' => array('id' => 'desc'),
'limit'=>20,
'fields' => array('id','name','latitude', 'longitude'),
);
//}
$datas = $this->Paginator->paginate();
foreach ($datas as $data){
$datas['Point'][] = array(
'id'=> $data['Point']['id'],
'name' => $data['Point']['name'],
'latitude' => $data['Point']['latitude'],
'longitude' => $data['Point']['longitude'],
);
}
header('Content-Type: application/json');
echo json_encode($datas);
exit;
$this->set('points', $this->Paginator->paginate());
}
0 件のコメント:
コメントを投稿