CodeIgniter Forums
Datamapper nestedsets and pagination - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Datamapper nestedsets and pagination (/showthread.php?tid=59530)



Datamapper nestedsets and pagination - El Forum - 10-16-2013

[eluser]kev[/eluser]
Hi,

I'm using the dump_tree method of nestedsets to return all the tree I have, is there anyway to paginate the results? I haven't see any example about this.

I'm using this to get the trees

Code:
$root
  ->select_root($root->root_id)
  ->get_root()
  ->dump_tree( NULL , 'array' , FALSE );

Can someone help please?


Datamapper nestedsets and pagination - El Forum - 10-16-2013

[eluser]WanWizard[/eluser]
No. As the name implies, dump_tree() dumps the entire tree.

You'll have to array_slice() in your controller if you only want to use parts of the result.