PHPackages                             elazar/flysystem-twig-loader - 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. elazar/flysystem-twig-loader

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

elazar/flysystem-twig-loader
============================

Flysystem-backed loader for Twig templates

1.0.0(1y ago)051MITPHPPHP ^8.2

Since Feb 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/elazar/flysystem-twig-loader)[ Packagist](https://packagist.org/packages/elazar/flysystem-twig-loader)[ RSS](/packages/elazar-flysystem-twig-loader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

`flysystem-twig-loader`
=======================

[](#flysystem-twig-loader)

[![PHP Version Support](https://camo.githubusercontent.com/2c07a8717563bff55302cfaf39a64fe38032ef0fc96609c43dba835e6512077d/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d706870266d6573736167653d2533453d253230382e322e3026636f6c6f723d626c7565)](https://packagist.org/packages/elazar/flysystem-twig-loader)[![Packagist Version](https://camo.githubusercontent.com/8e49c3a2af8951984addd6dc3f41c8fd9e3dc112d94aa324ff67a23c1ef4f923/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d7061636b6167697374266d6573736167653d312e302e3026636f6c6f723d626c7565)](https://packagist.org/packages/elazar/flysystem-twig-loader)[![Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Buy Me a Cofee](https://camo.githubusercontent.com/6cc1f89c6279c0e23c3041191d0a1784ab2f91fee6e8485d29c446d8370f54b1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275792532306d6525323061253230636f666665652d646f6e6174652d626c75652e737667)](https://ko-fi.com/elazar)

A [custom loader](https://twig.symfony.com/doc/3.x/api.html#create-your-own-loader) for [Twig v3](https://twig.symfony.com/doc/3.x/) templates backed by a [Flysystem v2/3](https://flysystem.thephpleague.com/v2/docs/) filesystem.

Released under the [MIT License](https://en.wikipedia.org/wiki/MIT_License).

Supported Use Cases
-------------------

[](#supported-use-cases)

This library is intended to be used in projects that meet the following criteria.

1. Uses the Twig template engine.
2. Uses the Flysystem filesystem access library.
3. Needs to load Twig templates from a Flysystem filesystem.

Unsupported Use Cases
---------------------

[](#unsupported-use-cases)

This library doesn't and won't support Flysystem v1 or Twig v1 or v2. If you want a library similar to this one that is compatible with those versions, see [cedricziel/twig-loader-flysystem](https://packagist.org/packages/cedricziel/twig-loader-flysystem).

Requirements
------------

[](#requirements)

- PHP 8.2+
- Flysystem 2.1+
- Twig 3

Installation
------------

[](#installation)

Use [Composer](https://getcomposer.org/).

```
composer require elazar/flysystem-twig-loader
```

**Note**: This will automatically install the latest version of the Flysystem core library that is available for your environment. However, you must handle installing adapters yourself. See [the Flysystem documentation](https://flysystem.thephpleague.com/docs/) for a list of official adapters.

Usage
-----

[](#usage)

The example below uses the [`league/flysystem-local`](https://packagist.org/packages/league/flysystem-local) adapter that is automatically installed with the Flysystem core library.

```
