2017 © Pedro Peláez
 

library silex-plates-provider

Provides Plates template engine to Silex.

image

rych/silex-plates-provider

Provides Plates template engine to Silex.

  • Sunday, July 27, 2014
  • by rchouinard
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1,000 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 4 Forks
  • 1 Open issues
  • 4 Versions
  • 7 % Grown

The README.md

Plates Template Engine for Silex

This project aims to provide integration of the Plates template engine into the Silex micro-framework. It's in the very early stages, so don't be surprised if the integration is less than optimal., (*1)

The project is based very heavily on the default TwigServiceProvider and some of the Symfony-Twig bridge extensions., (*2)

Usage

Add the provider to your composer.json file:, (*3)

{
    "require": {
        "rych/silex-plates-provider": "1.0.*"
    }
}

Enable it in your application:, (*4)

<?php

/* @var $app Silex\Application */
$app->register(new \Rych\Silex\Provider\PlatesServiceProvider(), array (
    'plates.path' => '/path/to/templates', // Required
    'plates.folders' => array (            // Optional
        'email' => '/path/to/email/templates';
    ),
));

$app->get('/', function () use ($app) {
    return $app['plates']->render('mytemplate');
});

Extensions

This provider also registers common extensions which work very similar to those found in the Symfony-Twig bridge. I hope to add more in the future, but right now I've only included the big ones I use regularly., (*5)

Routing Extension

Provides the url and path functions for generating URIs. This extension is only available if UrlGeneratorServiceProvider is registered., (*6)

Security Extension

Provides the is_granted function. This extension is only available if SecurityServiceProvider is registered., (*7)

Custom Extensions

You may choose to register your own Plates extensions. This can be accomplished easily by extending the plates.engine service., (*8)

<?php

/* @var $app Silex\Application */
$app['plates.engine'] = $app->share($app->extend('plates.engine', function($engine, $app) {
    $engine->addExtension(new \My_Plates_Extension());

    return $engine;
}));

The Versions

27/07 2014

dev-master

9999999-dev

Provides Plates template engine to Silex.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/07 2014

dev-plates2

dev-plates2

Provides Plates template engine to Silex.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/07 2014

v1.0.1

1.0.1.0

Provides Plates template engine to Silex.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/11 2013

v1.0.0

1.0.0.0

Provides Plates template engine to Silex.

  Sources   Download

MIT

The Requires

 

The Development Requires