gulch / assets
Package for gathering some type of assets (js, css) and write once into document.
1.1.2
2021-01-31 16:13 UTC
Requires
- php: ^7.1 || ^8.0
Requires (Dev)
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0
- satooshi/php-coveralls: ^2.0
- squizlabs/php_codesniffer: ^3.2
README
gulch/Assets
PHP Package for gathering some type of assets (js, css) and write once into document.
Special Thanks: Funtime Team.
Install
You will need Composer installed.
composer require gulch/assets
How to use
use gulch\Assets\Asset; use gulch\Assets\Renderer\BodyCssRenderer; $bodyCss = new Asset(new BodyCssRenderer); $bodyCss->add('asset1.css')->add('asset2.css'); // ... $bodyCss->add('asset3.css'); // ... and in your html template just write $bodyCss->write();
Result
<link href="asset1.css" rel="stylesheet" type="text/css" property="stylesheet"> <link href="asset2.css" rel="stylesheet" type="text/css" property="stylesheet"> <link href="asset3.css" rel="stylesheet" type="text/css" property="stylesheet">