2017 © Pedro PelĆ”ez
 

library twig-php-function

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

image

umpirsky/twig-php-function

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

  • Tuesday, February 20, 2018
  • by umpirsky
  • Repository
  • 4 Watchers
  • 37 Stars
  • 360,343 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 9 Forks
  • 2 Open issues
  • 3 Versions
  • 52 % 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

20/02 2018

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

13/03 2017

0.2.0

0.2.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

12/03 2016

v0.1

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires