Last active
December 14, 2015 01:19
-
-
Save tonysm/5005002 to your computer and use it in GitHub Desktop.
Listando todos os registros utilizando o paginator do CakePHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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