Estou tendo problema na paginação quando clico para trocar de página. Aparece o seguinte:
Not Found
Cake\Network\Exception\NotFoundException
Controller:
public function index()
{
$this->paginate = [
'contain' => ['Processos', 'Turmas', 'Responsaveis', 'Candidatos'],
'limit'=>10
];
$id =$this->Auth->user('id');
$processos = $this->Inscricoes->Processos->find('list')->select(['id'])->where(['status = 1'])->first();
$inscricoes = $this->paginate($this->Inscricoes->find()->where(['inscricoes.user_id = ' => $id])
->matching('Processos', function ($q) use ($processos) {
return $q->where(['processos.id =' => $processos]);
}));
$this->set(compact('inscricoes'));
$this->set('_serialize', ['inscricoes']);
}
Log:
[Cake\Network\Exception\NotFoundException] Not Found Request URL: /inscricoes/candidatos?page=2 Referer URL: http://localhost/cefet/inscricoes/candidatos Stack Trace: #0 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Controller\Controller.php(717): Cake\Controller\Component\PaginatorComponent->paginate(Object(App\Model\Table\ResponsaveisTable), Array) #1 C:\xampp\htdocs\cefet\src\Controller\AppController.php(37): Cake\Controller\Controller->paginate(Object(Cake\ORM\Query)) #2 C:\xampp\htdocs\cefet\src\Controller\InscricoesController.php(19): App\Controller\AppController->beforeFilter(Object(Cake\Event\Event)) #3 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Event\EventManager.php(414): App\Controller\InscricoesController->beforeFilter(Object(Cake\Event\Event)) #4 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Event\EventManager.php(391): Cake\Event\EventManager->_callListener(Array, Object(Cake\Event\Event)) #5 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Event\EventDispatcherTrait.php(78): Cake\Event\EventManager->dispatch(Object(Cake\Event\Event)) #6 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Controller\Controller.php(502): Cake\Controller\Controller->dispatchEvent('Controller.init...') #7 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\ActionDispatcher.php(114): Cake\Controller\Controller->startupProcess() #8 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\ActionDispatcher.php(93): Cake\Http\ActionDispatcher->_invoke(Object(App\Controller\InscricoesController)) #9 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\BaseApplication.php(78): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response)) #10 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\Runner.php(65): Cake\Http\BaseApplication->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner)) #11 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Routing\Middleware\RoutingMiddleware.php(59): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response)) #12 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\Runner.php(65): Cake\Routing\Middleware\RoutingMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner)) #13 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Routing\Middleware\AssetMiddleware.php(88): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response)) #14 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\Runner.php(65): Cake\Routing\Middleware\AssetMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner)) #15 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Error\Middleware\ErrorHandlerMiddleware.php(92): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response)) #16 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\Runner.php(65): Cake\Error\Middleware\ErrorHandlerMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner)) #17 C:\xampp\htdocs\cefet\vendor\cakephp\debug_kit\src\Middleware\DebugKitMiddleware.php(52): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response)) #18 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\Runner.php(65): DebugKit\Middleware\DebugKitMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner)) #19 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\Runner.php(51): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response)) #20 C:\xampp\htdocs\cefet\vendor\cakephp\cakephp\src\Http\Server.php(80): Cake\Http\Runner->run(Object(Cake\Http\MiddlewareQueue), Object(Cake\Http\ServerRequest), Object(Cake\Http\Response)) #21 C:\xampp\htdocs\cefet\webroot\index.php(37): Cake\Http\Server->run() #22 {main}