• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handling partial loads from the controller

#1
[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">
&lt;?= $this->load->view('elements/main_menu');?&gt;
</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.


Messages In This Thread
Handling partial loads from the controller - by El Forum - 06-11-2008, 02:30 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.