Download the PHP package aklump/twig-syntax without Composer
On this page you can find all versions of the php package aklump/twig-syntax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download aklump/twig-syntax
More information about aklump/twig-syntax
Files in aklump/twig-syntax
Download aklump/twig-syntax
More information about aklump/twig-syntax
Files in aklump/twig-syntax
Vendor aklump
Package twig-syntax
Short Description Write native php templates using a Twig-like syntax
License BSD-3-Clause
Homepage http://github.com/aklump/twig-syntax
Package twig-syntax
Short Description Write native php templates using a Twig-like syntax
License BSD-3-Clause
Homepage http://github.com/aklump/twig-syntax
Please rate this library. Is it a good library?
Informations about the package twig-syntax
Twig Syntax
Summary
This is an attempt to match Twig syntax in PHP.
Roadmap
I expect this to grow slowly as I need more functionality; I'm not trying to create a total solution, just bridge a temporary gap.
Examples 1
Twig
{% set classes = [
'mi',
'fa',
'so',
]|merge(classes) %}
TwigSyntax
$twig = new TwigSyntax;
...
$twig->set(array(
'mi',
'fa',
'so',
))->merge($classes);
The result is that $classes === ['mi', 'fa', 'so', 'do', 're']
.
Vanilla PHP
It is equivalent to:
$classes = array_merge(
array(
'mi',
'fa',
'so',
),
$classes
);
Examples 2
Ensuring that classes/$classes exits
Twig
{% set classes = [
'mi',
'fa',
'so',
]|merge(classes|default([])) %}
TwigSyntax
$twig = new TwigSyntax;
...
$classes = isset($classes) ? $classes : array();
$twig->set(array(
'mi',
'fa',
'so',
))->merge($classes);
All versions of twig-syntax with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.0
The package aklump/twig-syntax contains the following files
Loading the files please wait ....