uwej711/pimplex

Providers for symfony components for Pimple

dev-master 2013-11-11 12:02 UTC

This package is auto-updated.

Last update: 2024-10-15 00:24:56 UTC


README

This library contains ServiceProviders for Pimple to use Symfony 2 components.

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.

Usage:

<?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

<?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');