Wallogit.com
2017 © Pedro Peláez
LpiAssetLoader is a zend framework module that can be used in zf2 or zf3 layouts to load front end asset javascript and css files and frameworks
Created by LPinc, (*1)
LpiAssetLoader is a zend framework - ZF2 and ZF3 - module that helps configure the loading of front-end custom, bower, or npm javascript and css files and assets., (*2)
This module can be especially handy if you load AMD javascript modules in your layouts or view scripts., (*3)
To install LpiAssetLoader, simply recursively clone this repository (git clone
--recursive) into your ZF2 or ZF3 modules directory., (*4)
Add this project and LpiAssetLoader in your composer.json:, (*5)
"require": {
"lpinc/lpi-asset-loader": "~0.1"
}
Now tell composer to download ZfcUser by running the command:, (*6)
$ php composer.phar update
Enable LpiAssetLoader in your config/application.config.php file., (*7)
The LpiAssetLoader module has some options to help customize the basic functionality. After installing LpiAssetLoader, copy
./vendor/lpinc/lpi-asset-loader/config/lpiassetloader.global.php.dist to
./config/autoload/lpiassetloader.global.php and change the values as desired., (*8)
If you istalled dojo using nodejs npm, then a sample config might look like this:, (*9)
$settings = array(
'dojo_config_settings' => array(
'async' => true,
'parseOnLoad' => true
),
'dojo_on' => true,
'use_source' => true,
'base_vendor_src_path' => '/node_modules/',
'amd_vendor_modules' => array(
'dojo' => 'dojo',
'dijit' => 'dijit',
'dojox' => 'dojox'
)
);
return array(
'lpi-asset-loader' => $settings
);
if (is_object($this->LpiAssetLoader)) {
echo $this->LpiAssetLoader->getDojoConfig();
echo $this->LpiAssetLoader->getDojoInitAssets();
}