Skip to content

Instantly share code, notes, and snippets.

@tonysm
Last active December 14, 2015 01:19
Show Gist options
  • Select an option

  • Save tonysm/5005002 to your computer and use it in GitHub Desktop.

Select an option

Save tonysm/5005002 to your computer and use it in GitHub Desktop.
Listando todos os registros utilizando o paginator do CakePHP
<?php
App::uses('AppController', 'Controller');
class UsuariosController extends AppController {
public $paginate = array(
'limit' => 25
);
public function index() {
$usersCount = $this->Usuario->find('count');
$this->paginate['limit'] = $this->paginate['maxLimit'] = $usersCount;
$this->Usuario->recursive = 0;
$this->set('usuarios', $this->paginate());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment