New to CI so please excuse if this is an offensively straight forward fix.
I have a number of views where I need to be able to include the same piece of navigation like so:
...
<div class="projectNav">
<?php
echo anchor('projects/view/' . $project->intId, '<img src="'.base_url().'assets/img/icons/zoom.png" />');
echo anchor('tasks?project=' . $project->intId . '&status=open', '<img src="'.base_url().'assets/img/icons/puzzle.png" />');
echo anchor('projects/edit/' . $project->intId, '<img src="'.base_url().'assets/img/icons/edit.png" />');
echo anchor('projects/charges/' . $project->intId, '<img src="'.base_url().'assets/img/icons/sterling_pound_currency_sign.png" />');
?>
</div>
...
Obviously, as it is standard across each of the views, I don’t want to repeat myself. What is the best practice way to do “include” this nav with CI?
Will load nav.php in your views folder inside Application. This method can be run from a controller or view.