matthecat / silex-asset-provider
Asset service provider for Silex
Requires
- php: >=5.4.0
- silex/silex: <2
- symfony/asset: *
Requires (Dev)
- fabpot/php-cs-fixer: *
- phpunit/phpunit: *
- symfony/twig-bridge: >=2.7.0
Suggests
- symfony/twig-bridge: For using Twig asset function
This package is not auto-updated.
Last update: 2020-01-22 01:41:48 UTC
README
⚠️
You can still use this provider with Silex 1 but you'll have to switch to the native AssetServiceProvider
when upgrading.
AssetServiceProvider
The AssetServiceProvider leverages the Symfony asset component for Silex.
Parameters
- assets: Packages configuration.
The assets parameter follows the same convention than the Symfony Framework Bundle assets configuration. A package configuration is defined by an associative array with the following optional keys:
- base_path
- base_urls
- version
- version_format
These keys under assets define the default package configuration.
You can add packages adding a packages key under assets which value is an associative array with packages name as keys and their configuration as values.
Services
- asset.packages: An instance of
Symfony\Component\Asset\Packages
.
Registering
use MatTheCat\Asset\Silex\Provider\AssetServiceProvider; $app->register(new AssetServiceProvider());
Twig extension
You'll be able to use Twig asset
function by requiring symfony/twig-bridge
starting from 2.7.0.