CodeIgniter Forums

Full Version: wiredesignz Moduler Extension HMVC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Using HMVC  is best approach in CI?
Any security issues with HMVC?

I think in this way we breaking th original behaviour of CI MVC

plz guide me
Q. Using HMVC is best approach in CI?

A. For "best" I don't know. If your application is going to be sort of big, then it is an option to be considered. But, since wiredesignz HMVC is an external library, you have to examine how it works and you need to be capable to tweak it for compatibility with CI 3.1.x in the future, if it becomes needed. If you face problems about the installation you are on your own.

Q. Any security issues with HMVC?

A. Make sure, the controllers/widgets you create (and call with Modules::run(...)) are not accessible by the browser. See its manual, how this is to be made by using the method _remap(). This is not a security issue, it is just something that you should care of.

Q. I think in this way we breaking th original behaviour of CI MVC

A. No, the original MVC behavior stays as it is.
(05-04-2016, 05:31 AM)zohaibniaz788 Wrote: [ -> ]Using HMVC  is best approach in CI?
Any security issues with HMVC?

I think in this way we breaking th original behaviour of CI MVC

plz guide me

If you need some HMVC functionality you can simply extend core CI_Controller with MY_Controller with some methods like footer(), header(), foo_module(). And then create you application by extending MY_Controller.
You can invoke any "module" from within MY_Controller like below (my real example):

$this->load_header();
$this->load_left();
$this->load->view('account_list',$data);
$this->load_footer();

In this example "modules" header(), left() and footer() has own language file, view, model and so on.
@wishmaster

You are loading blocks/fragments in certain order, and this order is not information that belongs to a controller. If you redesign the templates there is probability all the controllers to need touching, this is not well.

Your proposition would be implemented better with a template engine that supports blocks, Twig for example.
(05-05-2016, 05:07 PM)ivantcholakov Wrote: [ -> ]Q. Any security issues with HMVC?

A. Make sure, the controllers/widgets you create (and call with Modules::run(...)) are not accessible by the browser. See its manual, how this is to be made by using the method _remap(). This is not a security issue, it is just something that you should care of.


to be honest i don't quite understand.
why should i care if a module controller is accessible from a browser - can you explain it pls?
@sintakonte

I don't think I should, look at the original text. https://bitbucket.org/wiredesignz/codeig...sions-hmvc

"All module controllers are accessible from the URL via module/controller/method or simply module/method if the module and controller names match. If you add the _remap() method to your controllers you can prevent unwanted access to them from the URL and redirect or flag an error as you like."