2017 © Pedro Peláez
 

library pimplex

Providers for symfony components for Pimple

image

uwej711/pimplex

Providers for symfony components for Pimple

  • Monday, November 11, 2013
  • by uwej711
  • Repository
  • 1 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ServiceProviders for Pimple for Symfony 2 components

This library contains ServiceProviders for Pimple to use Symfony 2 components., (*1)

The code for the providers was taken from Silex and modified to work with plain Pimple for use cases where you don't need the full (micro) framework, e.g. for adding Symfony Components to an existing PHP application. See the LICENSE file., (*2)

Usage:, (*3)

<?php
require_once __DIR__.'/vendor/autoload.php';

$container = new Pimplex\Container();
$container->register(new Pimplex\ServiceProvider\TwigServiceProvider());

container['twig.path'] = 'your-template-path';

echo $container['twig']->render('hello.twig', array('name' => 'World');

or if you use plain Pimple, (*4)

<?php
require_once __DIR__.'/vendor/autoload.php';

$container = new \Pimple();
$twigServiceProvider = new Pimplex\ServiceProvider\TwigServiceProvider();
$twigServiceProvider->register($container);

container['twig.path'] = 'your-template-path';

echo $container['twig']->render('hello.twig', array('name' => 'World');

The Versions