<?php $this->load->view('templates/_header'); ?>

<?php $this->load->view('templates/_nav'); ?>


<h3>posts list:</h3>

<?php

if (count($posts) > 0) {
    foreach($posts as $post) {
        echo '<h3>' . anchor(base_url().'posts/view/' . $post['id'], $post['title']) . '</h3>';
	    echo '<div>' . $post['content'] . '</div>';
    }
} else {
	echo '<div class="alert alert-warning">No posts to display.</div>';
}

?>

<?php $this->load->view( 'templates/_footer' ); ?>