nanjingboy/assetloader
最新稳定版本:v0.1.7
Composer 安装命令:
composer require nanjingboy/assetloader
包简介
A simple tool to load javascript & css files
关键字:
README 文档
README
AssetLoader:
AssetLoader is a simple library to load javascript & css files.
Getting Started:
- Create composer.json file in root directory of your application:
{
"require": {
"php": ">=5.4.0",
"nanjingboy/assetloader": "*"
}
}
-
Install it via composer
-
Create directory in root directory of your application:
$ 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:
- 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
License:
MIT
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-29