That makes a lot more sense. Jeremy Burns Class Outfit
http://www.classoutfit.com On 3 Jan 2012, at 05:48:21, Kanwal wrote: > > hi > > you can use > > $featuredposts=$this->Post->find('all',array('conditions' => > array('Post.featured' => '1'),'limit' => 10)); > $this->set('featured',$eaturedposts); > > $lastposts=$this->Post->find('all',array('order' => array('Post.id > DESC'),'limit' => 10)); > $this->set('lastposts',$lastposts); > > On Jan 2, 8:00 pm, "J." <[email protected]> wrote: >> I want to display both feat. and last posts on my home page. >> >> So, in my Pages controller, I have this : >> >> $this->loadModel('Post'); >> $posts = $this->set('posts', $this->Post->find('all', >> array('conditions' => array('Post.featured' => '1'),'limit' => 10))); >> >> and in my view I use : >> >> <?php foreach ($posts as $post): ?> >> >> How can I display latest posts in an other foreach too since I already >> defined it in the controller ? >> >> Thanks for your time ! > > -- > 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 -- 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
