PHP code example of acelaya / zf2-acassets

1. Go to this page and download the library: Download acelaya/zf2-acassets library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

acelaya / zf2-acassets example snippets


'modules' => array(
    'AcAssets', // <-- Add this line
    'Application',
),

<html>

    <head>
        <title>My web app</title>
        
            echo $this->headLink();
            echo $this->headScript();
        

[...]

<head>
    <title>My web app</title>
    
        echo $this->headLink()->appendStylesheet('/assets/css/mi-styles.css', 'all'); // <-- This is compatible with this module
    


return array(
    'css'   => array(
        'path'         => '/css',
        'stylesheets'  => array(
            'bootstrap'    => array(
                'name'     => 'bootstrap.min.css',
            ),
            'font.awesome'    => array(
                'name'     => 'fonts/font-awesome.min.css',
            ),
            'main'         => array(
                'name'     => 'main.min.css',
            ),
            'print'        => array(
                'name'     => 'print.min.css',
                'media'    => 'print'
            )
        )
    ),
    'js'    => array(
        'path'      => '/js',
        'inline'    => array(
            'bootstrap' => array(
                'name' => 'bootstrap.min.js',
                'priority' => 5
            ),
            'jquery' => array(
                'name' => 'jquery.min.js',
                'priority' => 10
            ),
            'main' => array(
                'name' => 'main.min.js',
            ),
        ),
        'head'      => array(
            'respond' => array(
                'name'     => 'respond.min.js',
                'options'  => array('conditional' => 'lt IE 9')
            ),
            'html5shiv' => array(
                'name'     => 'html5shiv.min.js',
                'options'  => array('conditional' => 'lt IE 9')
            ),
        )
    )
);

php composer.phar install