2017 © Pedro Peláez
 

kohana-module kohana-assets

Assets pipeline for Kohana Framework. Merges assets into one file.

image

snoblucha/kohana-assets

Assets pipeline for Kohana Framework. Merges assets into one file.

  • Sunday, August 14, 2016
  • by snoblucha
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Assets module pipeline for Kohana

This module merges assets into single file., (*1)

Example Usage:, (*2)

Css::fe()->add( '/bower_components/dropzone/dist/min/dropzone.min.css', 'dropzone' );
Css::fe()->add( '/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css', 'tagsinput' );
Css::fe()->add( '/css/jquery-ui-1.10.3.custom.min.css' );
Css::fe()->add( '/css/main.css' );

JS::footer()->add( 'bower_components/bootstrap/dist/js/bootstrap.min.js', 'bootstrap' );
JS::footer()->add( 'bower_components/metisMenu/dist/metisMenu.min.js', 'metisMenu' );
JS::footer()->add( 'bower_components/dropzone/dist/min/dropzone.min.js', 'dropzone' );
JS::footer()->add( 'bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js', 'bootstrap-tagsinput' );
JS::footer()->add( 'bower_components/typeahead.js/dist/typeahead.bundle.js', 'typeahead.js' );

//JS::footer()->add( 'bower_components/typeahead.js/dist/bloodhound.js', 'bloodhound.min.js' );
JS::footer()->add( 'js/main.js', 'main' );

In Your template then add, (*3)

<link rel="stylesheet" href="/css/index">

Config

In config you can define start path for assets group. For exampe for CSS you may define., (*4)

<?php
return array(
    'default' => array(
        'dir' => 'css',
        'cached' => false, # should cache asset, disabled for development
    ),

    'frontend' => array(
        'dir' => ''
    ),

    'backend' => array(
        'dir' => 'admin/css'
    ),

);

Css

Or any action available for CSS. There are predefined groups for asseets. in Css it is ::fe() for frontend and path /css/index, ::be() for backend assets and path /css/admin and ::fePrint() for print stylesheet at /css/print, (*5)

For custom keys there is defined path /css/get/:id that retrieves the correct key. For exampe /css/get/test will retrieve the combined assets for Css::instance('test')., (*6)

Js

It has a bit different key predefined. JS::footer is intended for combining script for the footer. On the place you put it, (*7)

<script src="/scripts/footer"></script>

The Versions

14/08 2016

dev-master

9999999-dev

Assets pipeline for Kohana Framework. Merges assets into one file.

  Sources   Download

MIT

The Requires

 

by Petr Snobl

14/08 2016

1.0.1

1.0.1.0

Assets pipeline for Kohana Framework. Merges assets into one file.

  Sources   Download

MIT

The Requires

 

by Petr Snobl

14/08 2016

1.0.0

1.0.0.0

Assets pipeline for Kohana Framework. Merges assets into one file.

  Sources   Download

MIT

The Requires

 

by Petr Snobl