Logical HTML.

Do most template parsers seem almost impossible. LHTML keeps the HTML format while allowing you to access the evolution core and bundles. Best part is if you read this and decide that you don't like it well you can easily write in your own.

The default portal is site so were going to use that for the purposes of this documentation.

Enabling LHTML on your portal

Open the portals/site directory and open the portal.yaml file. Then simply enable the LHTML bundle for routing. As you can see in this example.



Just write HTML. If you don't know how; then why are you here?

WARNING: Our parser is strict!

Using LHTML Variables

LHTML variables are set in PHP and E3 Bundles. $_GET and $_POST variables are hooked automatically and can be accessed by using {:get.var} and {:post.var} which translates to $_GET['var'] and $_POST['var'] etc...

You can add LHTML hooks by running \Bundles\LHTML\Scope::addHook(':myHook', $var); where $var can be a string, array, or even an object. If it is an array or foreachable object you can iterate through the variable by adding <p :load=":myHook as var">{var.name}</p> and the contents of the html element will be looped until the available iterations runs out.

Using Functions in LHTML

Along with parsing variables LHTML can also run and output methods of hooked objects. Just insert code like this {:myHook.myFunction(arg1, arg2, ...)} if you don't have any arguments just run {:myHook.myFunction}. It is also possible to stack functions by running something like this {:myHook.myFunction.myFunctionsFunction(arg1).etc.etc}.

Using LHTML Tags

LHTML tags change how the stack is outputted. They are additional html tags that are not parsed as html but rather trigger some kind of action. An example of this would be an IF/Else condition. Which you could do like this <:if cond=":myHook.myFunction !== FALSE"> and anything under the if condition will only output if the condition returns true. Available conditions are ==, ===, !=, !==, >, <, >=, <=.

Heres an example of a if condition if $_GET['show'] == '1'

Creating your own LHTML tags

create a file in your bundle and namespace it to Bundles\LHTML. Name your class Node_MyTag where "MyTag" would be literally be <:MyTag>. Then just alter the how it outputs the node stack. Take a moment to review a YouTube tag to help you understand.

Download Evolution
System Requirements
PHP >= 5.3
Apache >= 2.0
MySQL >= 5.1
Apache mod_rewrite ~
PHP mbstring ~
PHP pcre ~