nanjingboy/assetloader 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固