fadoe / symfony-asset-module
Use Symfony Asset as Zend Framework Module
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:module
Requires
Requires (Dev)
- phpunit/phpunit: ^4.8
- zendframework/zend-i18n: ^2.5
- zendframework/zend-log: ^2.5
- zendframework/zend-mvc: ^2.5
- zendframework/zend-serializer: ^2.5
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