Welcome Guest, Not a member yet? Register   Sign In
Layout module for HMVC modular extensions
#1

[eluser]emateu[/eluser]
Hi, just released this project. I would like to know what do you think. Maybe there are some bugs... it's on developing. Thanks!

https://github.com/emateu/codeigniter-la...odule-hmvc

Layout Module for HMVC

Quote:The Layout Module is a module for the Modular Extensions - HMVC library for the CodeIgniter framework. Layout Module is inspired on the Magento layout system. The goal is to provide a simple, orderly and practical way to handle the layout in projects.
#2

[eluser]Rok Biderman[/eluser]
Hey Emiliano,

I've checked out the code and it seems interesting and really nicely written. You could maybe try to avoid loading css and js files from the module folder as it reveals the folder structure. It doesn't sound like much, but I usually refrain from giving out any unnecessary info plus it looks more clean and you can consolidate all the assets in their respective folders.

I haven't used Magento at all, so I'm probably missing some benefits of working with xml layouts, but it somehow don't seem the quickest thing to do, if your goal is to facilitate the turnaround from getting the design files to turning in a finished product. I'm fairly certain that I'm missing something and I'd like to find out what the benefits of your approach are as compares to this kind of quick and dirty approach. I've resorted to this after being disappointed by most other solutions I found, but yours really seems promising. I can imagine people being interested in it.
#3

[eluser]wiredesignz[/eluser]
@emateu, If you want to do this properly you might want to investigate using an asset controller to output the contents of module based image, css and js files which also outputs the appropriate html headers for each and then use view caching to improve performance.
#4

[eluser]solid9[/eluser]
I just watched.
I'll check it out later.
interesting...
#5

[eluser]emateu[/eluser]
Hello, thanks for watching and write your opinion.

@Coccodrillo
The benefit is a less messy code in the controller and the possibility to define a general configuration. Watch this code please:

https://github.com/emateu/codeigniter-la...rs/doc.php

There isn't code like ... $this->layout->addCss('styles.css') for example (but it could be if you need it).

With this implementation there are 4 levels of configuration:
1) Global, 2) Per module, 3) Per controller, 4) Per view.

So in the global config, for example, you can load all generic css files and define a default layout and then, for example, in module scope or controller scope made some overrides: remove or add stuff.

Global config:
https://github.com/emateu/codeigniter-la...efault.xml

Controller config:
https://github.com/emateu/codeigniter-la...ut/doc.xml --> extends the global config... for example: add prettify.js/css stuff (because I only use them there), add a class="any class" to the body... etc. Here is the result: layoutmodule.com.ar/starting/doc

May be is just a matter of taste, but I prefer this insted of controllers with lot of layout definitions. The module is simple and small.

Respect from retriving the js, img, and css files from module folder, it can be changed easily, I would like to know what are the benefits. I prefere there so the module is more portable and easy to read. But again, is up tou you. Is there any security issue? Thanks for your comments.

@wiredesignz
I was trying to understand your comment but I can't, could you explain me a bit more please? The module doesn't generate js, css or img files, so I don't understand where the headers play. I'm agree with a cache implementation to improve performance. Thanks.

@solid9
Thanks for watching.

Sorry if my english is not the best, regards!
#6

[eluser]Rok Biderman[/eluser]
Thanks for clarification, you made some valid points.




Theme © iAndrew 2016 - Forum software by © MyBB