wshafer / assetmanager
An assetmanager module for Zend Framework.
Requires
- php: ^5.6 || ^7.0
- wshafer/assetmanager-core: ^1.0.0
- zendframework/zend-component-installer: ^1.0 || ^0.7.0
- zendframework/zend-modulemanager: ^2.8.0
- zendframework/zend-mvc: ^3.1.0
- zendframework/zend-psr7bridge: ^0.2.2
Requires (Dev)
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ~3.0
- zendframework/zend-cache: ^2.7.1
- zendframework/zend-mvc-console: ^1.1
Suggests
- zendframework/zend-mvc-console: zend-mvc-console provides the ability to expose zend-mvc as a console application
Provides
Conflicts
None
Replaces
None
README
AssetManager For Zend Framework
Fork of the original ZF2 Assetmanager By Wesley Overdijk and Marco Pivetta
Introduction
This module is intended for usage with a default directory structure of a
ZendSkeletonApplication. It provides functionality to load
assets and static files from your module directories through simple configuration.
This allows you to avoid having to copy your files over to the public/ directory, and makes usage of assets very
similar to what already is possible with view scripts, which can be overridden by other modules.
In a nutshell, this module allows you to package assets with your module working out of the box.
Installation
- Require assetmanager:
./composer.phar require wshafer/assetmanager:2.0.0-beta2
Usage
Take a look at the wiki for a quick start and more information. A lot, if not all of the topics, have been covered in-dept there.
Sample module config:
<?php return array( 'asset_manager' => array( 'resolver_configs' => array( 'collections' => array( 'js/d.js' => array( 'js/a.js', 'js/b.js', 'js/c.js', ), ), 'paths' => array( __DIR__ . '/some/particular/directory', ), 'map' => array( 'specific-path.css' => __DIR__ . '/some/particular/file.css', ), ), 'filters' => array( 'js/d.js' => array( array( // Note: You will need to require the classes used for the filters yourself. 'filter' => 'JSMin', ), ), ), 'view_helper' => array( 'cache' => 'Application\Cache\Redis', // You will need to require the factory used for the cache yourself. 'append_timestamp' => true, // optional, if false never append a query param 'query_string' => '_', // optional ), 'caching' => array( 'js/d.js' => array( 'cache' => 'Apc', ), ), ), );
Please be careful, since this module will serve every file as-is, including PHP code.
Questions / support
If you're having trouble with the asset manager there are a couple of resources that might be of help.
- The FAQ wiki page, where you'll perhaps find your answer.
- Issue tracker. (Please try to not submit unrelated issues).