fadoe/symfony-asset-module

Use Symfony Asset as Zend Framework Module

1.0.0 2016-01-10 11:06 UTC

This package is auto-updated.

Last update: 2024-12-12 22:09:29 UTC


README

Installation

Install fadoe/symfony-asser-module via composer.

Configuration

The config key is fadoe_symfony_asset_module. You can extend the configuration in your autoload/global.php:

return [
    'fadoe_symfony_asset_module' => [
        'version' => 1,
        'version_format' => null,
        'base_path' => null,
        'base_urls' => null,
        'packages' => [],
    ],
];

Example

Asset version is 1, the format is <image>?v=<version>. There is also a named package named project in path image/projects.

return [
    'fadoe_symfony_asset_module' => [
        'version' => 1,
        'version_format' => "%s?v=%s,
        'base_path' => null,
        'base_urls' => null,
        'packages' => [
            'project' => [
                'version' => 1,
                'base_path' => 'image/project'
            ],
        ],
    ],
];

In you template you can now write:

<?php echo $this->assetUrl('image.jpg'); ?>

This will output:

image.jpg?v=1

When you use the naming package configuration:

<?php echo $this->assetUrl('image.jpg', 'project'); ?>

Here is the result:

/image/project/image.jpg?1