[eluser]cahva[/eluser]
Define your array differently, it will be easier to handle. Like:
Code:
$posts = array();
$posts[] = array(
'title' => 'Test post1',
'body' => 'Test Body1',
'author' => 1
);
$posts[] = array(
'title' => 'Test post2',
'body' => 'Test Body2',
'author' => 1
);
Then you can easily handle posts in the view:
Code:
<?php foreach ($posts as $post): ?>
<h3><?php echo $post['title'] ?> by <?php echo $post['author'] ?></h3>
<p><?php echo $post['body'] ?></p>
<?php endforeach; ?>