2017 © Pedro PelĆ”ez
 

library twig-php-function

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

image

pongtan/twig-php-function

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

  • Wednesday, November 23, 2016
  • by orvice
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11,958 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

symfony upgrade fixer • twig gettext extractor • wisdom • centipede • permissions handler • extraload • gravatar • locurro • country list • transliterator , (*1)

Twig PHP Function Build Status

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

Usage

After registering PhpFunctionExtension call PHP functions from your templates like this:, (*3)

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:, (*4)

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

or restrict what functions are allowed like this:, (*5)

$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., (*6)

The Versions

23/11 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

23/11 2016

v0.1

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires