Welcome Guest, Not a member yet? Register   Sign In
View files with common data
#8

[eluser]Bramme[/eluser]
I agree with wiredesignz and xwero that you shouldn't put any logic in your views. Keep them stupid, but there is however a very easy way to solve your problem:

change your view into
Code:
<?php foreach ($blogEntries as $blogEntry): ?>
    <h1>&lt;?=$blogEntry['title']?&gt;></h1>

    &lt;?php $this->load->view('userinfo', $blogEntry['user']); ?&gt;

    <br /><br />
&lt;?php endforeach; ?&gt;
and your userinfo view would look like this:
Code:
&lt;!-- USERINFO:  --&gt;
    Username: &lt;?=$nickname?&gt;<br />
    Rating: &lt;?php echo $this->ratingcounter->get_rating($points); ?&gt;
    &lt;!-- /USERINFO --&gt;
&lt;?php endforeach; ?&gt;


Messages In This Thread
View files with common data - by El Forum - 09-05-2008, 12:06 AM
View files with common data - by El Forum - 09-05-2008, 01:00 AM
View files with common data - by El Forum - 09-05-2008, 01:10 AM
View files with common data - by El Forum - 09-05-2008, 01:40 AM
View files with common data - by El Forum - 09-05-2008, 01:42 AM
View files with common data - by El Forum - 09-05-2008, 01:47 AM
View files with common data - by El Forum - 09-05-2008, 02:53 AM
View files with common data - by El Forum - 09-05-2008, 02:57 AM
View files with common data - by El Forum - 09-05-2008, 03:11 AM
View files with common data - by El Forum - 09-05-2008, 03:14 AM
View files with common data - by El Forum - 09-05-2008, 06:35 AM
View files with common data - by El Forum - 09-05-2008, 07:18 AM
View files with common data - by El Forum - 09-05-2008, 07:40 AM
View files with common data - by El Forum - 09-05-2008, 08:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB