-
-
Save raisiqueira/6bd4ed8f3c574fd3df2e to your computer and use it in GitHub Desktop.
This file contains 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 | |
//Rota de Paginaçnao | |
/** | |
* Rotina recebe o parametro $pagina para poder realizar a paginação | |
**/ | |
$application->get('/minharota/:pagina', function ($pagina) use ($twig_engine) { | |
$registros_por_pagina=20; | |
$meusdados = Capsule::table('minhatabela')->skip($registros_por_pagina*$pagina)->take($registros_por_pagina)->get(); | |
$minha_view = $twig_engine->loadTemplate('meutema.html'); | |
echo $minha_view->render(array('dados_paginados' => $meusdados)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment