Re: controller setup - pagination
This is correct : $this-paginate('Product'); On Wed, Sep 16, 2009 at 7:10 AM, borcho boris.nenc...@gmail.com wrote: Hi, I am new to CakaPHP and I cannot figure out how to paginate products listed under a category (many to many relationship) and also use category table fields in the same view. I set up my controller like this but I am pretty sure it's wrong even though it works. Any feedback would be appreciated. Thanks. class StoresController extends AppController { var $name = 'Stores'; var $helpers = array('Html', 'Form'); var $paginate = array('Products'=array('limit'=5)); function view($id = null) { if (!$id) { $this-flash(__('Invalid Store', true), array('action'='index')); } $this-set('products', $this-paginate($this-Store-Product)); $this-set('store', $this-Store-findById($id)); } } -- Paul-Cosmin Constandachi Tel: 0723.46.46.42 --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: controller setup - pagination
Thanks! On Sep 16, 2:11 am, Cosmin Paul cosmin.p...@gmail.com wrote: This is correct : $this-paginate('Product'); On Wed, Sep 16, 2009 at 7:10 AM, borcho boris.nenc...@gmail.com wrote: Hi, I am new to CakaPHP and I cannot figure out how to paginate products listed under a category (many to many relationship) and also use category table fields in the same view. I set up my controller like this but I am pretty sure it's wrong even though it works. Any feedback would be appreciated. Thanks. class StoresController extends AppController { var $name = 'Stores'; var $helpers = array('Html', 'Form'); var $paginate = array('Products'=array('limit'=5)); function view($id = null) { if (!$id) { $this-flash(__('Invalid Store', true), array('action'='index')); } $this-set('products', $this-paginate($this-Store-Product)); $this-set('store', $this-Store-findById($id)); } } -- Paul-Cosmin Constandachi Tel: 0723.46.46.42 --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---