Is there a way to get CakePHP 2.8 JSON views to encode numbers as numbers instead of strings?
I would like to avoid creating /json/*.ctp
view files with echo json_encode($data, JSON_NUMERIC_CHECK)
if at all possible and have the standard _serialize
method below encode numbers properly by default.
public function index(){
$items = $this->Paginator->paginate();
$this->set(array(
'items' => $items,
'_serialize' => array('items')
));
}