zendframework/zend-expressive-twigrenderer

Name: zend-expressive-twigrenderer

Owner: Zend Framework

Description: Twig integration for Expressive

Created: 2015-10-11 01:49:05.0

Updated: 2018-05-07 22:17:49.0

Pushed: 2018-04-09 20:49:35.0

Homepage: null

Size: 326

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Twig Integration for Expressive

Build Status Coverage Status

Provides Twig integration for Expressive.

Installation

Install this library using composer:

mposer require zendframework/zend-expressive-twigrenderer

We recommend using a dependency injection container, and typehint against container-interop. We can recommend the following implementations:

Twig Extension

The included Twig extension adds support for url generation. The extension is automatically activated if the UrlHelper and ServerUrlHelper are registered with the container.

Configuration

If you use the zend-component-installer the factories are configured automatically for you when requiring this package with composer. Without the component installer, you need to include the ConfigProvider in your config/config.php. Optional configuration can be stored in config/autoload/templates.global.php.

plates' => [
'extension' => 'file extension used by templates; defaults to html.twig',
'paths' => [
    // namespace / path pairs
    //
    // Numeric namespaces imply the default/main namespace. Paths may be
    // strings or arrays of string paths to associate with the namespace.
],

g' => [
'cache_dir' => 'path to cached templates',
'assets_url' => 'base URL for assets',
'assets_version' => 'base version for assets',
'extensions' => [
    // extension service names or instances
],
'runtime_loaders' => [
    // runtime loaders names or instances   
],
'globals' => [
    // Global variables passed to twig templates
    'ga_tracking' => 'UA-XXXXX-X'
],
'timezone' => 'default timezone identifier, e.g.: America/New_York',
'optimizations' => -1, // -1: Enable all (default), 0: disable optimizations
'autoescape' => 'html', // Auto-escaping strategy [html|js|css|url|false]

Documentation

See the Expressive Twig documentation.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.