Welcome Guest, Not a member yet? Register   Sign In
HMVC - Calling view (and other resources) that is located in another module
#1

[eluser]ckissi[/eluser]
Hello,

I need to call view that belongs to other module .so e.g.

I want to call /modules/blog/views/view_detail.php from /modules/news/views/view_news.php

How can I do that ?

Also ... In global... how can I load resources from module if those belongs to other modules ?
I mean views,models or controllers..

Thank you in advance.
#2

[eluser]Michael Wales[/eluser]
Wick (forum thread) allows you to load and render one controller from another - providing a pretty unique, and easy to use, solution to HMVC (not really HMVC, but damn cool).

Matchbox is another library by Zacharias Knudsen and it's a full-fledged HMVC library.

Both of these have been used and abused by the community pretty extensively and are in great shape for real world use.
#3

[eluser]wiredesignz[/eluser]
@micheal, neither Wick nor Matchbox provide HMVC. (HMVC concerns Model View Controller, not just Controller in Wicks case)

Please get your facts right and stop misleading people.
#4

[eluser]wiredesignz[/eluser]
@ckissi, Try prefixing the resource you wish to cross load with the module name.

Example:
Code:
$this->load->library('module/library');

For a module controller:
Code:
$this->load->module('module/controller');

//or

$this->load->module('module');  // module and controller share the same name.
#5

[eluser]Michael Wales[/eluser]
Quote:Please get your facts right and stop misleading people.

It wasn't intentional - I actually meant to link to your extension but got confused between Modular Extensions and Modular Seperation (which preceded Matchbox).

Thanks for clearing it up for everyone - does Matchbox only support modularity for Controllers?
#6

[eluser]sophistry[/eluser]
There are currently two ways of setting up modular application design in CI. Matchbox and Modular Extensions (ME).

I've been testing Modular Extensions and AFAIK it is the only currently maintained solution to allow nested modules (aka HMVC - getting one module's resources from another without an extra call through the http interface which would load up another CI instance, etc...) - see the wiki for complete explanation.

Matchbox provides a way to organize files modularly but does not allow pulling one module's resources from another.

So, Modular Extensions provides the ability to do a modular application *and* it allows HMVC.

Wick allows you to gather another controller's output without a call through the http interface, but (as wiredesignz notes) does not currently integrate with any modular design. see this page of the wick thread that addresses some of the issues around integrating Matchbox and Wick which are both Zacharias Knudsen productions.




Theme © iAndrew 2016 - Forum software by © MyBB