- ADDED: Support for assetic/framework 3.0
- FIXED: Accidentally overwritten PhpRenderer
- REMOVED: Renamed namespace from
AsseticBundle
toFabiang\AsseticBundle
- REMOVED: Drop support for Zend Framework, all classes now use the Laminas namespace
- REMOVED: Drop support for PHP <7.4
- ADDED: support for Mezzio as a middleware
- ADDED: All classes are using proper type-hints, return-types and are type strict
- Fork of original module
- Use PSR-4
- Replaced original Assetic library with assetic/framework 2.0
- Make module compatible to Laminas Framework
- Allow symfony/console 4.0 and 5.0
- Upgrade minimum PHP version to 5.4
- Composer.json is now more friendly for external libraries (^)
- Add Vagrantfile
-
Added the possibility to define assets to actions
Example controller configuration
'controllers' => array( 'ModuleName\Controller\ControllerName' => array( 'actions' => array( 'actionName' => array( '@collection_name', ), ), '@base_css', '@base_js', ), ),
-
Refactored view helper and added an ability to prevent browser cache when the file is updated.
<?php echo $this->asset('login_ie7_head_js', array('addFileMTime' => true))
-
Added view helper to have an ability to include asset collections in the view script manually.
Only the collection name is required.
<!--[if IE 7]> <?php echo $this->asset('login_ie7_head_js', array('type' => 'text/javascript')) ?> <?php echo $this->asset('login_ie7_css', array('media' => 'screen', 'type' => 'screen', 'text/css' => 'stylesheet')) ?> <![endif]-->
Register view helper in your module if necessary:
<?php public function getViewHelperConfig() { return array( 'factories' => array( 'asset' => function($helpers) { /** @var HelperPluginManager $helpers */ $sl = $helpers->getServiceLocator(); return new Helper\Asset($sl); }, ), ); }
-
Availability to get filters from ServiceManager
<?php 'twitter_bootstrap_css' => array( 'assets' => array( '/path/to/bootstrap/file.less' ), 'filters' => array( 'BootstrapLessCompiler' ), );
<?php // BootstrapLessCompiler filter factory class public function createService(ServiceLocatorInterface $serviceLocator){ $filter = new LessphpFilter(); $defaultPresets = $serviceLocator->get('config'); $defaultPresets = array_merge($defaultPresets['bootstrap_less']['default'], $defaultPresets['bootstrap_less']['application']); $filter->setPresets($defaultPresets); return $filter; }
- Simply front page
- Improve documentation
- Create out of the box configuration
config/assets.config.php.dist
- #29 - pass more arguments to filter constructor
- #74 - now only assets match in request are build
- #80 - In debug mode, asset collection is move as separate file, not as single file.
- use cache buster only when cache is enabled or have cache buster enabled
-
All route configurations that match the current route will now be merged. This is especially useful when used in combination with the regular expressions previously introduced.
<?php return array( 'assetic_configuration' => array( 'routes' => array( 'admin/.*' => array( '@specific_admin_js ), 'admin/(dashboard|reports|etc)/.+' => array( '@admin_css', '@admin_js' ) ) ) );
If now route
admin/page
gets matched by ZF2 only asset@specific_admin_js
is selected. If routeadmin/reports/x
is matched by ZF2 both assets@specific_admin_js
andadmin_css
andadmin_js
get selected.
- Added possibility to specify
regex
in route name. example:
<?php
return array(
'assetic_configuration' => array(
'routes' => array(
// in the name of route there can be any regex.
// it will be automatically prepended by '^' and appended by '$'
// during matching phase
'admin/(dashboard|reports|etc)/.+' => array(
'@admin_css',
'@admin_js'
)
)
)
);
- Asset collections defined on route level can now match the current route using regular expression
- Create console actions, run
php index.php
to see more informations - Option to disable/enable generating assets on fly
'buildOnRequest' => true
- by default is set totrue
for backward compatybility. My recomendation is to set this to false on production enviroment. - Cleanup, refactoring
- Added cache buster strategy
- Start tagging releases
- Optional filters in debug mode
- Added configurable umask
- Added configurable acceptable errors #54
- Update description how to merge
- Change behavior for option "baseUrl" now is detected by ZF2 (in ServiceFactory::createService)
- New configuration option "basePath"
- Composer is now recommended way of installation.
- Fix issue #36: Case insesitive module name in configuration required
- Fix issue #30: Possible Assets may apply where they are not wanted
- Wrote tests
- Add travis-ci
- Remove old code
- Add AsseticBundleServiceAwareInterface
- Composer support added, now is recommended way of installation
- Remove vendor directory
- New installation process
- Rewrite AsseticBundle\Service to determinate how to set up template to use resources (link, script) depending on Zend\View\Renderer
- Assetic configuration namespace was change from:
array(
'di' => array(
'instance' => array(
'assetic-configuration' => array(
'parameters' => array(
'config' => array(/* configuration */)
)
)
)
)
);
to:
array('assetic_configuration' => array(/* configuration */));