[eluser]Aria Rajasa[/eluser]
I am sorry if this question have been posted, but i've search regarding partials and have not succeeded in finding them, so here goes..
I have inclue a view under a view like this (in my view/layout/default.php)
Code:
..
<div id="topbarleft">
<?= $this->load->view('elements/main_menu');?>
</div>
..
And i would like it if i can enable and disable the loading of that 'elements' in the controller (like the Elements plugin in cakePHP). Maybe something like this in a controller:
Code:
..
function test_method() {
$this->loadElements(array('a', 'b', 'c');
..
With a, b, c as the name of the elements. And of course in the view, i can count it like in Joomla. maybe like this:
Code:
..
if($this->elements-count('a') > 0) {
//display something
}
..
Is there a good way to do it? Thank you so much for further help.