dawn/asset

php load fronted asset

Installs: 16

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/dawn/asset

1.0.1 2018-11-11 14:09 UTC

This package is auto-updated.

Last update: 2025-10-14 05:56:36 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.