Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

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.

  1. After installing skeleton application, install AssetsBundle as explained above.

  2. Then just create cache directory into "public/".

cd to/your/project/public/dir/
mkdir cache
  1. 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')
        	)
        ),
        //...
    );
  2. 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')
  3. Save & Refresh.

Clone this wiki locally