Download the PHP package html5/template without Composer
On this page you can find all versions of the php package html5/template. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download html5/template
More information about html5/template
Files in html5/template
Package template
Short Description Inline Templating component
License MIT
Homepage http://leuffen.de
Informations about the package template
Html5 Template - Template Rendering
angularjs-like inline-templates for PHP7.
Planned as replacement for PHPTAL - which is quite fine but not enough extensible for cluster / platform usage.
Gismo Template does not precompile any code. It generates the pages on the fly.
Features:
- Works with HTML5 and XHTML (XHTML preferred)
- IDE supported template-development
- Generate HTML, plain-Text or struct-data from one file
- Supports macros
- Import other templates from virtual storage (cloud-ready)
- Verbose and useful error-messages with lineNo and xpath
- Secure and powerful expression engine (Symfony Component also used by Twig)
Example
Template:
Parser:
Install using Composer
Attributes
go-if
: Conditiongo-foreach
: Loopgo-repeat
: Loopgo-continue
: Loop start-overgo-break
: Quit loopgo-bind
: Inject string datago-html
: Inject html data
Conditions
Foreach Loops
Repeat Loops
break / continue a loop
You can use conditions to break or continue a loop
or use continue to skip elements:
Bind escaped Value
The data will be escaped by htmlspecialchars()
Bind Html-Code
Add CSS Classes dynamicly
Show/Hide Elements
if hidden it adds the css-class
ng-hide
(also used by angularjs)
Elements
go-text
: Inject Textgo-define
: Define Variables in Scopego-dump
: Dump a variable or scopego-macro
: Define a macrogo-callmacro
: Call a macrogo-struct
: Return array data sections defined by go-sectiongo-section
: Define or overwrite struct data
Interceptors
Macros
Macros can be used to create Output on multiple positions. To define a macro use the go-macro
-Element:
To generate your Table use go-callmacro
- Element:
Benchmark
Small Example from above:
Big demo with ~2000 Lines of template-code
Installing V8JS on Ubuntu 16.04
Since there is no apt package for v8js you have to do it manually:
Author
Written 2016 by Matthias Leuffen http://leuffen.de
All versions of template with dependencies
gismo/expression-language Version ^3.1
symfony/yaml Version *
html5/htmlreader Version ^1.1