Adding views in modules
#1
Adding views in modules
Currently the modules folders structure is:

- assets (for images/css/js).
- code ( for main module php core).
- hooks ( sentora daemon related code).

The common way of building html to concatenate html in the module currently.

Issue:

Changing the design is  complicated. 

Solution:
Adding a new folder:
- views

Where we store store views partials and load them using MUSTACHE:
https://github.com/bobthecow/mustache.php

The rendering would be like:
Code:
$m = new Mustache_Engine; echo $m->render(mytemplate, array('vars' => 'values!'));



We could also move later to handlebars, mustache views could easily used by JS too later as there is a mustache parser in JS:

http://mustache.github.io/
https://github.com/janl/mustache.js 

I plan already to add Mustche in /etc/lib as I will use it for Apache Admin module and vhosts building.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit


Messages In This Thread
Adding views in modules - by Me.B - 02-20-2016, 10:23 PM
RE: Adding views in modules - by TGates - 02-22-2016, 07:08 PM
RE: Adding views in modules - by Me.B - 02-22-2016, 08:15 PM
RE: Adding views in modules - by jacobg830 - 02-24-2016, 05:57 AM
RE: Adding views in modules - by Me.B - 02-24-2016, 07:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Application Error: [0204] - problems when adding an A Record of more than 65 A record andrabcm 8 26 ,747 07-30-2019, 11:11 AM
Last Post: andrabcm
[WISH] Hookable methods on/for modules Bizarrus 0 3 ,883 03-23-2019, 06:32 AM
Last Post: Bizarrus
Reminder for modules devs Me.B 0 11 ,083 02-20-2016, 09:42 PM
Last Post: Me.B

Forum Jump:


Users browsing this thread: 1 Guest(s)