pdima88 / phpassets
PHP的小型资产管理器
1.0
2019-05-23 05:56 UTC
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2024-09-23 18:11:12 UTC
README
PHP的小型资产管理器
用法
使用添加静态方法来包含所需的资源
use pdima88\phpassets\Assets; ... Assets::add('bootstrap'); // include asset library, defined in Assets::$libs Assets::add('css/main.css'); // include single css file Assets::add('js/script.js'); // include single js file // or all at once: Assets::add([ 'bootstrap', 'css/main.js', 'js/script.js' ]);
在模板中输出js和css标签
Assets::getCss(); // put this inside <head> ... </head> to output styles tags Assets::getJs(); // put this in the end of page before </body> to output js script tags