Hi,
Look at the code fragment bellow … How can I access $this->Paginator if it was not initialized within my class. If I dump the object, I can see it is a PaginatorComponent object. How cake handle that? Can someone give me an example?
class PaginasController extends AppController
{
public $components = array(‘Paginator’);
public $paginate = array(
‘limit’ => 5,
‘order’ => ‘Pagina.modified DESC’,
‘fields’ => array(‘Pagina.id’, ‘Pagina.title’, ‘Pagina.created’, ‘Pagina.modified’)
);
public function index()
{
$this->Paginator->settings = $this->paginate;
$paginas = $this->Paginator->paginate();
$this->set(compact('paginas'));
}
}