2017 © Pedro Peláez
 

module symfony-asset-module

Use Symfony Asset as Zend Framework Module

image

fadoe/symfony-asset-module

Use Symfony Asset as Zend Framework Module

  • Monday, May 7, 2018
  • by fadoe
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Symfony Asset Module

Installation

Install fadoe/symfony-asser-module via composer., (*1)

Configuration

The config key is fadoe_symfony_asset_module. You can extend the configuration in your autoload/global.php:, (*2)

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., (*3)

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:, (*4)

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

This will output:, (*5)

image.jpg?v=1

When you use the naming package configuration:, (*6)

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

Here is the result:, (*7)

/image/project/image.jpg?1

The Versions