public function api_index() { $this->response->type(['json' => 'application/json']); $this->Clinica->recursive = 0;
$this->set([ 'response' => $this->Paginator->paginate(), '_serialize' => array('response') ]); }{
"response": [
{
"Clinica": {
"id": 9,
"razon_social": "Clinica de Prueba 1",
"rif": "J012345678",
"estado_id": 1,
"direccion": "AV. PRINCIPAL A CON CALLE B, URB. C, CARACAS",
"telf_principal": "02122000000",
"telf_segundario": null,
"email": null,
}
}
]
}
$this->Paginator->settings = array( 'limit' => 4 );
http://denuncias.local/api/clinicas/index.json/clinicas/index/page:1 hasta N paginashttp://denuncias.local/api/clinicas/index.json
public function api_index() { $this->response->type(['json' => 'application/json']); $this->Clinica->recursive = 0; $this->Paginator->settings = array( 'limit' => 10, 'maxLimit' => 100, 'paramType' => 'querystring'// Parametros por GET );
$this->set([ 'response' => $this->Paginator->paginate(), '_serialize' => array('response') ]); }Hola
Yo he empezado, pero aun no he terminado a desarrollar paginación con esto
http://crud.readthedocs.org/en/latest/listeners/api-pagination.html
Con eso creas la api que haga de paginador.
Con backbone.js o thorax.js la parte de cliente, de forma sencilla puedes gestionar las peticiones ajax
Y me falta enlazar la presentación de la tabla de datos que creo que lo haré con esto
http://backgridjs.com/ref/extensions/paginator.html
Espero que te sirva de ayuda