[eluser]nhm tanveer hossain khan (hasan)[/eluser]
gotcha

i don't think that is harming core philosophy so much since you are not writing the whole logic which was written under "get_categories" method. though you could load them under controller and send them over a variable. (which MVC suggests)
i am pretending this bunch of view code is used for creating modular component. which is not actually controller action dependent.
i have followed the following method in my code -
Code:
<?= render_categories() ?>
on helper you should have the following code -
Code:
function render_categories() {
$this->load->view("common/categories", array(
"categories" => $this->sidebar->get_categories()
));
}
On common/categories.php
Code:
<ul>
<? foreach ($categories as $cat) : ?>
<li><$=cat->title; ?></li>
<? endforeach; ?>
</ul>
it gives me chance to separate my logic and view with in the component scope. so later if i decide to change the logic in the category retrieval process or use separate library i don't need to touch the view.
best wishes