How can i generate a tree list with a pagination ?
Is there any combination between $this->paginate('Category') and $this-
>Category->generatetreelist(null, null, null, '--')
Thank you.
Model :
class Category extends AppModel {
var $name = "Category";
var $actsAs = array('Tree');
var $validate = array(
'name' => array(
'rule' => array('maxLength', 255),
'required' => true,
'allowEmpty' => false,
'message' => 'Title is required.',
),
);
}
Controller :
class CategoriesController extends AppController {
var $name = 'Categories';
var $helpers = array('Html', 'Form');
var $paginate = array('limit' => 10, 'page' => 1);
function admin_index() {
if ( isset($_POST["limit"]) ) $this->passedArgs['limit'] =
$_POST["limit"];
$this->set('categories', $this->paginate('Category'));
$this->layout = "admin";
}
--~--~---------~--~----~------------~-------~--~----~
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 cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment