2017 © Pedro Peláez
 

library silex-twig-helper

Provide a better way to use Twig for Silex. This is base on Silex/Application/TwigTrait.php by Fabien Potencier and add some helpful functions.

image

wake/silex-twig-helper

Provide a better way to use Twig for Silex. This is base on Silex/Application/TwigTrait.php by Fabien Potencier and add some helpful functions.

  • Wednesday, July 4, 2018
  • by Wake
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 19 % Grown

The README.md

Silex Twig Helper

Provide a better way to use Twig with Silex, base on Silex/Application/TwigTrait.php by Fabien Potencier., (*1)

Usage

$app->get('/hello/{name}', function ($name) use ($app) {

  // Original way
  /*
  return $app->render ('hello.twig', [
    'name' => $name,
  ]);
  */

  // A better way
  return $app
    ->assign ('name', $name)
    ->render ('hello.twig');

  // Or

  $app->assign ('name', $name);

  // some code
  // ...

  return $app->render ('hello.twig');
});

Installation

Add in your composer.json with following require entry:, (*2)

{
  "require": {
    "wake/Silex-Twig-Helper": "*"
  }
}

or using composer:, (*3)

$ composer require wake/Silex-Twig-Helper:*

then run composer install or composer update., (*4)

Trait

class MyApplication extends Silex\Application {
  use Silex\Application\TwigHelperTrait;
}

Feedback

Please feel free to open an issue and let me know if there is any thoughts or questions :smiley:, (*5)

License

Released under the MIT license, (*6)

The Versions

04/07 2018

dev-master

9999999-dev https://github.com/wake/Silex-Twig-Helper

Provide a better way to use Twig for Silex. This is base on Silex/Application/TwigTrait.php by Fabien Potencier and add some helpful functions.

  Sources   Download

MIT

The Requires

 

twig silex

04/07 2018

dev-develop

dev-develop https://github.com/wake/Silex-Twig-Helper

Provide a better way to use Twig for Silex. This is base on Silex/Application/TwigTrait.php by Fabien Potencier and add some helpful functions.

  Sources   Download

MIT

The Requires

 

twig silex