Overwrite the method in any class (controller or even appcontroller/
appmodel) that inherits the library's class (controller/model)
On Sep 5, 6:52 am, Jaime [EMAIL PROTECTED] wrote:
It is possible to define custom paginate() and paginateCount() methods
in a model.
But sometimes many models can share that same pagination methods, and
therefore they could be defined in a single behavior. However, the
core paginate() method in Cake's core (default) controller only calls
the custom method when they are found in the model:
// From /cake/libs/controller/controller.php, line 990:
if (method_exists($object, 'paginate')) {
$results = $object-paginate($conditions, $fields, $order, $limit,
$page, $recursive);
}
A workaround for this is to set the custom paginate methods in the
AppModel. However, it would be much nicer if the core paginate()
method would search for custom methods both in the model AND in it's
behavior.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---