pug-php / pug-assets
Pug模板资源管理器
资助包维护!
kylekatarnls
Open Collective
Tidelift
Requires
- php: >=5.4
- pug-php/pug: ^2.0.2 || ^3.0.0
- pug-php/pug-filter-coffee-script: ^1.2
- pug-php/pug-filter-less: ^1.0
- pug-php/pug-filter-markdown: ^1.1
- pug-php/pug-filter-react: ^1.0
- pug-php/pug-filter-stylus: ^2.0
- pug-php/pug-minify: ^1.1
Requires (Dev)
- phpunit/phpunit: ^4.8.36 || ^5.7.27 || ^8.5.15
This package is auto-updated.
Last update: 2024-08-29 04:42:53 UTC
README
管理您的资源和第三方转译器(less、stylus、coffee、babel等),并允许您在生产环境中进行合并和/或压缩。
安装
首先,如果您还没有,需要安装composer: https://getcomposer.org.cn/download/
然后在您的项目根目录下,打开终端并输入
composer require pug-php/pug-assets
启用插件
use Pug\Assets; use Pug\Pug; $pug = new Pug(); // The facade syntax: Assets::enable($pug); $pug->render('... minify ...'); // here you can use minfiy, assets or concat keywords to wrap your assets Assets::disable($pug); $pug->render('... minify ...'); // here minfiy, assets or concat are simple tags again // Or the instanciation syntax: $assets = new Assets($pug); $pug->render('... minify ...'); // here you can use minfiy, assets or concat keywords to wrap your assets unset($assets); $pug->render('... minify ...'); // here minfiy, assets or concat are simple tags again
有关concat/minify使用的更多信息,请参阅https://github.com/pug-php/pug-minify#readme
Pug-Assets 还安装了coffee、react-jsx、stylus、less和markdown pug过滤器,以使用它们作为内联内容。