2017 © Pedro Peláez
 

library silex-twig-simple-asset-extension

Simple twig asset function for Silex

image

entea/silex-twig-simple-asset-extension

Simple twig asset function for Silex

  • Wednesday, January 14, 2015
  • by Entea
  • Repository
  • 3 Watchers
  • 16 Stars
  • 4,973 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Usage

require_once __DIR__ . '/silex.phar';

$app = new Silex\Application();
$app['debug'] = true;
$app['autoloader']->registerNamespaces(array('Entea'   => __DIR__.'/src'));
$app->register(
    new Silex\Provider\TwigServiceProvider(),
    array(
         'twig.path' => __DIR__ . '/views',
         'twig.class_path' => __DIR__ . '/vendor/twig/lib',
    )
);

/* @var Twig_Environment $twig */
$twig = $app['twig'];
$twig->addExtension(new \Entea\Twig\Extension\AssetExtension($app));

$app->get('/', function() use (&$app)
    {
        return $app['twig']->render('index.html.twig', array());
    });

$app->run();

And then, in your twig file:, (*1)

{{asset('/style/hello.css')}}

or with a specific version which overrides the global version, (*2)

{{asset('/style/hello.css', '1.2')}}

Properties

  • asset.directory: Your asset directory
  • asset.version: Your asset global version (default: 1.0)

Installation

Via composer:

require: "entea/silex-twig-simple-asset-extension": "dev-master"

or, (*3)

require: "entea/silex-twig-simple-asset-extension": "v1.0.1"

Or simply checkout this repo :), (*4)

The Versions

14/01 2015

dev-master

9999999-dev http://github.com/Entea/Silex-Twig-Simple-Asset-Extension

Simple twig asset function for Silex

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nurlan Turdaliev

twig silex asset

14/01 2015

v1.0.1

1.0.1.0 http://github.com/Entea/Silex-Twig-Simple-Asset-Extension

Simple twig asset function for Silex

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nurlan Turdaliev

twig silex asset

13/11 2012

v1.0.0

1.0.0.0 http://github.com/Entea/Silex-Twig-Simple-Asset-Extension

Simple twig asset function for Silex

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Nurlan Turdaliev

twig silex asset