Default pagination settings are stored in a class variable called
$paginate - just change this before your action; something like this:
class MyController extends Controller {
var $paginateEx = array(
'default' => array(
// Put defaults here [unless you have an action called 'default'
of course]
),
'myBlogs' => array(
'limit' => 5,
'conditions' => 'blah blah woof woof'
)
);
function beforeFilter() {
if (isset($this->paginateEx[$this->action])) {
$this->paginate = $this->paginateEx[$this->action];
}
else {
$this->paginate = $this->paginateEx['default'];
}
}
}
hth
grigri
On Apr 15, 5:19 am, aj <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I want to have different pagination conditions for different functions
> in my controller.
> For example:
> function index()
> {
> $criteria = "nodeType LIKE 'Blog'";
> $data = $this->Blog->paginate($criteria);
> $this->set('data',$data);
> }
>
> function myBlogs()
> {
> $criteria = "nodeType LIKE 'Forum'";
> $data = $this->paginate($criteria);
> $this->set('data', $data);
> }
>
> Can someone show me how to do this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---