[eluser]Colin Williams[/eluser]
I don't the answer to the latter questions, but I do have bit of an opinion on the main issue.
I don't think loop logic in a view is terrible, but I would reserve it only for properties of the main object the view is responsible for presenting. For example, a page that lists blog posts should call a blog_post view file in a loop.
Code:
$data['posts'] = "";
foreach ($this->blog->posts() as $post(
{
$data['posts'] .= $this->load->view('blog/post', array('post' => $post), TRUE);
}
$this->load->view('blog/list', $data);
Say that $post object had an array of attached images. I wouldn't find it awful to have the views/blog/post.php file loop through $post->images to display each one
Code:
<ul class="images">
<? foreach ($post->images as $img) : ?>
<li><image src="<?= $img->src ?>" alt="<?= $img->alt ?>" /></li>
<? endforeach; ?>
</ul>
I know there's no <image> tag, but the forum stripped out the proper img tag.