Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - Version 4.3

[eluser]jbowman[/eluser]
[quote author="darksky0" date="1207184089"]Wait I'm a bit confused... wouldn't you use AJAX for multiple controller calls? :ohh:



Btw this thing is really good lol... CI must have this feature integrated with CodeIgniter2[/quote]

Not all browsers support javascript, for example, mobile browsers. If you're building a portal type application being able to call multiple controllers can be very helpful.

[eluser]codex[/eluser]
Hey wiredesignz,

I gotta thank you for this fine library. You did an excellent job!

[eluser]wiredesignz[/eluser]
You're very welcome codex, I enjoyed building it and also learned a lot about MVC and CI. Wink

[eluser]wiredesignz[/eluser]
I recommend everyone take a look at this article How to use Model-View-Controller which describes the original concepts of MVC in relation to Smalltalk-80.

It is clear to me after reading the article that the idea of a single Controller doing everything (as used in CI and other frameworks) doesn't fully meet the original design.

A single page (screen or output) is constructed by using multiple MVC triads (modules aka partials) where the Controllers communicate with each other using the Observer pattern.

For me this implies Modular Extensions is actually more MVC than HMVC.

Anyway if you are interested have a read for yourselves and post your thoughts. (also posted in the lounge)

[eluser]dfau[/eluser]
Hi wiredesignz,

Just want to check something: in a modules' controller I do this:
Code:
$this->load->view('foobar');
which goes and loads foobar.php from the modules' view directory. In foobar.php I do this:
Code:
<?php $this->load->view('foobar_header') ?>
with the intention of loading the header from the same module, but it doesn't work. This is because the load->view() is dealt with by the CI loader and not the modules loader, right? So from a module view we can't load other module views from the same module?

If that's the case, then I guess it would be best to look at a substitute view library...

Thanks,
df

[eluser]wiredesignz[/eluser]
I'm an advocate of not using $this inside a View anyway, Instead you can provide a reference to the module loader in a variable and pass that to your View.
Code:
//module code
$data['load'] =& $this->load;
return $this->load->view('foobar', $data);

//view code
<?php echo $load->view('foobar_header') ?>
I haven't tried this, but can't see any reason why it shouldn't work (famous last words) Wink

[eluser]Daeli[/eluser]
One bug: You can't load views stored in view subfolders of modules.

[eluser]wiredesignz[/eluser]
You can, Just specify the path under modules:
Code:
//modules/admin/views/main/menu.php
$this->load->view('admin/views/main/menu');
Hope this helps.

[eluser]Daeli[/eluser]
Oh sure - but isn't that not HMVC? I mean when i call the view from within the module it should be able to load it without module name

[eluser]wiredesignz[/eluser]
Well it doesn't break any rules, but it is a bit inconvenient. :lol:




Theme © iAndrew 2016 - Forum software by © MyBB