Download the PHP package lovecoding/twig-asset without Composer
On this page you can find all versions of the php package lovecoding/twig-asset. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lovecoding/twig-asset
More information about lovecoding/twig-asset
Files in lovecoding/twig-asset
Package twig-asset
Short Description A simple twig asset extension for Slim 3.x
License MIT
Informations about the package twig-asset
Simple Twig Asset
This is a simple twig asset extension for Slim 3.x helper manage your resource in the Twig templating component. When you want to change the public resource, with the traditional way, you must change URL resource one by one for each resource in each template .twig
. With TwigAsset, you don't worry about that, with simple way, you can change all of the resources to new URL. Besides, it's helping you against browser cached resource with a set suffix at the end of resource URL, all of that is automated. And so more it can do.
Install
Via Composer
Requires Slim Framework 3.x and PHP 7.0.0 or newer.
Usage
Setup
-
In php
- In
home.html
In this version TwigAsset
only provide one function to your Twig templates:
- `asset(path, namespace)` - returns the real URL resource from your `path`.
- path - your static `path`.
- namespace - group the resource to only one name, the url will be shorted.
Example settings
-
Example 1
-
Example 2
- Example 3
License
The MIT License (MIT). Please see License File for more information.
All versions of twig-asset with dependencies
psr/http-message Version ^1.0
symfony/asset Version ^4.2
twig/twig Version ^2.0|^3.4