dawn/asset

php load fronted asset

1.0.1 2018-11-11 14:09 UTC

This package is auto-updated.

Last update: 2024-09-14 03:38:51 UTC


README

Asset类的目的是前端资源的注册器,目的是为了管理资源依赖

Install

$ composer install dawn/asset

Userage

$manager = AssetManager::getInstance();
$manager->register(array(
    'jquery' => array(
        'name' => 'jquery',
        'url' => 'http://localhost/examples/',
        'js' => array('jquery.min.js'),
        'css' => array('jquery.min.css'),
    ),
    'bootstrap' => array(
        'name' => 'bootstrap',
        'url' => 'http://localhost/examples/',
        'js' => array('bootstrap.min.js'),
        'css' => array('bootstrap.min.css'),
        'dependency' => array('jquery'),
    ),
));

$manager->enqueue('bootstrap');

License

This project is under MIT License. See the LICENSE file for the full license text.