Web Interfaces of PROSUME
Francesco Arcarese 7e50298209 updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
..
examples updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
spec/Umpirsky/Twig/Extension updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
src/Umpirsky/Twig/Extension updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
tests/Umpirsky/Twig/Extension updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
.gitignore updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
.travis.yml updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
README.md updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
composer.json updated LICENSE and README + upload of the whole project files and sql dump 2 years ago
composer.lock updated LICENSE and README + upload of the whole project files and sql dump 2 years ago

README.md

<a href="https://github.com/umpirsky">
    <img src="https://farm2.staticflickr.com/1709/25098526884_ae4d50465f_o_d.png" />
</a>

symfony upgrade fixertwig gettext extractorwisdomcentipedepermissions handlerextraloadgravatarlocurrocountry listtransliterator

Twig PHP Function Build Status

Call (almost) any PHP function from your Twig templates.

Usage

After registering PhpFunctionExtension call PHP functions from your templates like this:

Hi, I am unique: {{ uniqid() }}.

And {{ floor(7.7) }} is floor of 7.7.

Extend

You can control allowed PHP functions by adding new ones like this:

$extension = new Umpirsky\Twig\Extension\PhpFunctionExtension();
$extension->allowFunction('hash_hmac');

or restrict what functions are allowed like this:

$extension = new Umpirsky\Twig\Extension\PhpFunctionExtension(['floor', 'ceil']);

If you think that some function should be allowed/not allowed, feel free to raise issue or submit a pull request.