-
-
Notifications
You must be signed in to change notification settings - Fork 0
Use with Zend Skeleton Application
Emilien Escalle edited this page Jan 8, 2019
·
5 revisions
This example shows how to convert Zend Skeleton Application to manage assets via AssetsBundle.
https://docs.zendframework.com/tutorials/getting-started/skeleton-application/
composer update
Follow the installation instructions
The skeleton application uses css and js files so we have install tedivm/jshrink & tubalmartin/cssmin :
composer require tedivm/jshrink tubalmartin/cssmin
mkdir -p data/AssetsBundle/processed public/cache
Adding the configuration fragment below:
return [
//...
'assets_bundle' => [
'assets' => [
'css' => [
'css',
],
'js' => [
'js/jquery-3.1.0.min.js',
'js/bootstrap.min.js',
],
'media' => [
'img',
'fonts',
],
]
],
//...
];
7. Edit layout file module/Application/view/layout/layout.phtml
, removing prepend function for assets:
// Remove these lines
->prependStylesheet($this->basePath() . '/css/bootstrap-responsive.min.css')
->prependStylesheet($this->basePath() . '/css/style.css')
->prependStylesheet($this->basePath() . '/css/bootstrap.min.css')
->prependFile($this->basePath() . '/js/bootstrap.min.js')
->prependFile($this->basePath() . '/js/jquery.min.js')