bigmichi1 / assetmanager
An assetmanager module for Laminas Framework 2.
Installs: 1 670
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.2
- assetic/framework: ~2.0.0
- laminas/laminas-eventmanager: ^3.2.1
- laminas/laminas-loader: ^2.6.0
- laminas/laminas-modulemanager: ^2.8.3
- laminas/laminas-mvc: ^3.1.1
- laminas/laminas-servicemanager: ^3.3.1
- laminas/laminas-stdlib: ^3.2.1
- scssphp/scssphp: ~1.0
Requires (Dev)
- laminas/laminas-cache: ^2.8.0
- laminas/laminas-console: ^2.7.0
- laminas/laminas-http: ^2.8.0
- laminas/laminas-view: ^2.10.0
- phpmd/phpmd: ^2.9
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.12.49
- phpstan/phpstan-deprecation-rules: ^0.12.5
- phpstan/phpstan-strict-rules: ^0.12.5
- phpunit/phpunit: ^8.5.0
- squizlabs/php_codesniffer: ^3.3.1
Suggests
- ext-mbstring: ext-mbstring improves the calculation of the response size
- laminas/laminas-mvc-console: laminas-mvc-console provides the ability to expose laminas-mvc as a console application
This package is auto-updated.
Last update: 2020-12-30 09:26:49 UTC
README
By Wesley Overdijk and Marco Pivetta and Michael Cramer
Introduction
This module is intended for usage with a default directory structure of a
LaminasSkeletonApplication. 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 bigmichi1/assetmanager
#when asked for a version, type "2.*".
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' => 'Filesystem', ), ), ), );
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.
- Join us on gitter
- The FAQ wiki page, where you'll perhaps find your answer.
- RWOverdijk at irc.freenode.net #zftalk.dev or #spoonx
- Issue tracker. (Please try to not submit unrelated issues).
Todo
The task list has been slimmed down a lot lately. However, there are still a couple of things that should be done.
- Renewing the cache