I need to disable pagination on cakephp 2
I get a list of elements by using PDO queries without cake find methods.
and set the result as $this->set('elements', $elements);
if I dont use $this->paginate(); I just can view the "view" as plain text, without the layout; something like:
id name Actions 1 jhon Delete 2 Pep Delete
but without any css. And viewing page source
<div class="index">
<table cellpadding="0" cellspacing="0">
<tr>
<th>id</th> [...]
Means that begins on the view template, but without layout. I put a beforeFilter function calling the 'default' layout i use:
function beforeFilter(){
parent::beforeFilter();
$this->layout = 'default';
}
but nothing happens. If I put $this->paginate(), the the layout is rendered, but I don't make unnecessary queries. Any idea? Thanks