Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

cassiosantos/templating-service-provider

 
 

Repository files navigation

Templating Service Provider

A service to help you with template engine implementation using PHP or Twig.

Install

composer require sergiors/templating-service-provider
use Sergiors\Silex\Provider\TemplatingServiceProvider;

$app->register(new TemplatingServiceProvider(), [
    'templating.paths' => '__DIR__.'/../Resources/views/%name%' // or an array
]);

$app['templating']->render(/.../);

If you want to use Twig:

use Silex\Provider\TwigServiceProvider;
use Sergiors\Silex\Provider\TemplatingServiceProvider;

$app->register(new TwigServiceProvider(), [
    'twig.path' => __DIR__.'/../Resources/views'
]);
$app->register(new TemplatingServiceProvider());

$app['templating']->render(/.../);

Don't forget to install twig/twig and symfony/twig-bridge to use the Twig.

License

MIT

About

Template engine implementation using PHP or Twig for Silex

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.2%
  • Twig 0.8%