I'm trying to do simple pagination with cake and getting the following
error: "Warning (4096): Object of class JsHelper could not be
converted to string [CORE/cake/libs/view/helpers/html.php, line 444]"
Here is my code:
//controllers/orders_controller.php
class OrdersController extends AppController {
var $components = array("Security");
var $helpers = array("Html", "Form", "Session", "Number",
"Paginator");
var $uses = array('Product', 'Order');
var $paginate = array('limit' => 10,'order' => array('Order.date'
=> 'asc'),'recursive' => 2);
function view($id = null) {
if ($id == NULL) {
$this->set("orders", $this->paginate("Order"));
$this->set("js", array("jquery-1.6.2.min",
"viewOrders")); //Set a JS variable to be put on the head
} else {
$orders[0] = $this->Order->getOrder($id);
$this->set("orders", $orders);
}
}
}
The only place I'm calling the paginate function is here in the
controller. Not calling anything (yet) on the view/model. If I comment
the $this->set("orders", $this->paginate("Order")); line the error
stops. Any idea?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php