This repository has been archived by the owner on Oct 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Use with Zend Skeleton Application
neilime edited this page Aug 30, 2016
·
1 revision
This example shows how to convert ZF2 Skeleton Application to manage assets via AssetsBundle.
-
After installing skeleton application, install AssetsBundle as explained above.
-
Then just create cache directory into "public/".
cd to/your/project/public/dir/
mkdir cache
-
Edit the application module configuration file
module/Application/config/module.config.php
, adding the configuration fragment below:<?php return array( //... 'assets_bundle' => array( 'assets' => array( 'css' => array('css'), 'js' => array( 'js/jquery.min.js', 'js/bootstrap.min.js' ), 'media' => array('img','fonts') ) ), //... );
-
Edit layout file
module/Application/view/layout/layout.phtml
, removing prepend function for assets:<?php //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')
-
Save & Refresh.