2017 © Pedro Peláez
 

library twig-extensions

image

plemi/twig-extensions

  • Saturday, July 6, 2013
  • by dguyon
  • Repository
  • 3 Watchers
  • 5 Stars
  • 368 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Plemi Twig extensions

Base64 encoding for images

Basic Twig function to allow base64 images encoding following latest RFC., (*1)

Usage in the real world

First of all, add this to your composer.json., (*2)

{
    "require": {
        "plemi/twig-extensions": "dev-master"
    }
}

Symfony2

<service id="plemi.twig.base64_extension" class="Plemi\Twig\Extensions\Base64Extension" public="false">
    <tag name="twig.extension" />
</service>

Silex

<?php

// After registering Twig Silex Provider
$app['twig']->addExtension(new \Plemi\Twig\Extensions\Base64Extension());

Then in your twig templates, just call the function with the file path as an argument., (*3)

{{ image64('/images/logo.jpg') }}

The Versions

06/07 2013

dev-master

9999999-dev https://github.com/Plemi/Twig-extensions

  Sources   Download

MIT

The Requires

 

by David Guyon
by Xavier Hermans

base64 strpad