mvanvu / php-assets
Php Assets Manager package
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:php
Requires
- php: >=7.1
- ext-json: *
- matthiasmullie/minify: ^1.3
This package is auto-updated.
Last update: 2021-02-27 09:42:04 UTC
README
Deprecated
Since the Php-form version 1.0.1 has removed the php-assets | Don't use this anymore
Php Assets Manager package
{ "require": { "mvanvu/php-assets": "~1.0" } }
Alternatively, from the command line:
composer require mvanvu/php-assets
About
- Using while you're handling Php and want to dynamic adding the css/js assets contents
- Auto minifies the assets contents (Thanks to matthiasmullie/minify)
Usage
use MaiVu\Php\Assets; // Add assets Assets::addFile('path/to/file.css'); Assets::addFile('path/to/file.js'); // OR Assets::addFiles( [ 'path/to/file.css', 'path/to/file.js', ] ); // Inline assets Assets::inlineCss('body {margin: 0; padding: 0}'); Assets::inlineJs('alert("It works")'); // Compress assets Assets::compress(); // Render Header echo Assets::output('css'); echo Assets::output('inlineCss'); echo Assets::output('js'); echo Assets::output('inlineJs');