PHPackages                             liip/frctl-twig - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. liip/frctl-twig

ActiveLibrary[Templating &amp; Views](/categories/templating)

liip/frctl-twig
===============

Alias-Loader for handling fractal @handle's in twig and callable handler for the accompanied node module

v1.0.0(7y ago)86.0k5[2 issues](https://github.com/liip/frctl-twig/issues)[1 PRs](https://github.com/liip/frctl-twig/pulls)MITPHP

Since Aug 3Pushed 5y ago4 watchersCompare

[ Source](https://github.com/liip/frctl-twig)[ Packagist](https://packagist.org/packages/liip/frctl-twig)[ RSS](/packages/liip-frctl-twig/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

About
=====

[](#about)

frctl-twig is an adapter consisting of an NPM and a Composer package. It integrates the [Twig PHP](https://twig.symfony.com) template engine into [fractal](https://fractal.build).

Installation
============

[](#installation)

Inside your fractal project add a composer package by adding a composer.json:

```
{
  "name": "my/fractal-project",
  "type": "project",
  "require-dev": {
    "liip/frctl-twig": "dev-master"
  },
}

```

Run `composer install`.

Add a `devDependencies` to the fractal twig adapter into your package.json:

```
"frctl-twig": "git+https://github.com/liip/frctl-twig.git#master"

```

Run `npm install`.

Adding Twig Extensions
----------------------

[](#adding-twig-extensions)

Add any relevant composer packages to your composer.json.

For exampe run `composer require twig/twig-extensions`.

Then add a file `php-twig/TwigExtensions.php` to your fractal project with the following content:

```
