Views and PHP Code

[quote author="Colin Williams" date="1233569738"]... or you can loop from the controller, calling a view on each iteration, and send the result to the view. ...[/quote]

I am not really familiar with this solution can you give me an example of how you do this please? I always loop in my views when it comes to display data since I am fine with looping in views.. Smile

[eluser]Colin Williams[/eluser]
$data['blog_posts'] = $this->blog->get_recent();
$data['posts'] = '';
foreach ($data['blog_posts'] as $post)
   $data['posts'] .= $this->load->view('blog/post_teaser', array('post' => $post), TRUE);
$this->load->view('blog/recent', $data);

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.