2017 © Pedro Peláez
 

library assetloader

A simple tool to load javascript & css files

image

nanjingboy/assetloader

A simple tool to load javascript & css files

  • Friday, November 14, 2014
  • by Tom
  • Repository
  • 1 Watchers
  • 0 Stars
  • 39 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

AssetLoader:

AssetLoader is a simple library to load javascript & css files., (*1)

Getting Started:

  • Create composer.json file in root directory of your application:
 {
    "require": {
        "php": ">=5.4.0",
        "nanjingboy/assetloader": "*"
    }
}
  • Install it via composer, (*2)

  • Create directory in root directory of your application:, (*3)

 $ mkdir tmp/assetLoader -p
 $ chmod -R a+w tmp
  • Init the config in your bootstrap.php:
<?php
require __DIR__ . '/vendor/autoload.php';
AssetLoader::init($serverRootPath, $jsDirectoryPath, $cssDirectoryPath);

Usage:

We can use the require or require_dir directive to load the dependencies, there are the formats for this directive below:, (*4)

  • CoffeeScript:
# require dependency
# require_dir dependency_dir
  • JavaScript, Scss, Less:
// require dependency
// require_dir dependency_dir
  • JavaScript, Css, Scss, Less(single line):
/* require dependency */
/* require_dir dependency_dir */
  • JavaScript, Css, Scss, Less(multi line):
/**
 * require one_dependency
 * require two_dependency
 * require_dir dependency_dir
 */

Notes:

  • The require comments must on the top in a asset file.
  • The dependency's path is relative with the root directory path of your javascripts or stylesheets.
  • The require_dir directive auto load all files in this directory without recursive.
  • It's just used to parse the load paths for asset's dependencies, it can't compile any files(e.g. a coffeeScript file).

Example:

Get a example from test, (*5)

License:

MIT, (*6)

The Versions

14/11 2014

dev-master

9999999-dev https://github.com/nanjingboy/assetloader

A simple tool to load javascript & css files

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Tom Huang

css javascript load

14/11 2014

v0.1.7

0.1.7.0 https://github.com/nanjingboy/assetloader

A simple tool to load javascript & css files

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Tom Huang

css javascript load

13/11 2014

v0.1.5

0.1.5.0 https://github.com/nanjingboy/assetloader

A simple tool to load javascript & css files

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Tom Huang

css javascript load

12/11 2014

v0.1.3

0.1.3.0 https://github.com/nanjingboy/assetloader

A simple tool to load javascript & css files

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Tom Huang

css javascript load

03/11 2014

v0.1.0

0.1.0.0 https://github.com/nanjingboy/assetloader

A simple tool to load javascript & css files

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Tom Huang

css javascript load