2017 © Pedro Peláez
 

library fwk-twig

image

nitronet/fwk-twig

  • Friday, June 3, 2016
  • by neiluJ
  • Repository
  • 1 Watchers
  • 0 Stars
  • 36 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

fwk-twig

Brings Twig template engine support for Fwk\Core Applications., (*1)

Installation

1: Install the sources

Via Composer:, (*2)

{
    "require": {
        "nitronet/fwk-twig": "dev-master",
    }
}

If you don't use Composer, you can still download this repository and add it to your include_path PSR-0 compatible, (*3)

2: Defines Twig as a Service

Define a Twig_Environment instance in your Di Container, and configure it the way you want:, (*4)

``` xml true , (*5)

:packageDir/path/to/templates , (*6)

@twig.loader @twig.config , (*7)


### 3: Register Twig ResultType Registers a new ResultType in fwk.xml: ``` xml <result-type name="twig" class="FwkTwig\TwigResultType"> <param name="twigService">twig</param> </result-type>

4: Enjoy!

Use the ResultType where you want:, (*8)

xml <action name="Home" shortcut="MyApp\Controllers\Home:show"> <result name="success" type="twig"> <param name="file">home.twig</param> </result> </action>, (*9)

Contributions / Community

  • Issues on Github: https://github.com/nitronet/fwk-twig/issues
  • Follow Fwk on Twitter: @phpfwk

The Versions

03/06 2016

dev-master

9999999-dev

  Sources   Download

BSD

The Requires

 

by Avatar neiluJ