bootpress/asset

Caches and delivers assets of every sort, from any location, with hands-off versioning. Manipulates images on-the-fly. Minifies and combines (on-demand) css and javascript files.

v1.1.1 2024-07-24 23:49 UTC

This package is not auto-updated.

Last update: 2024-11-28 01:27:45 UTC


README

Packagist License MIT HHVM Tested PHP 7 Supported Build Status Code Climate Test Coverage

Asset::cached() is a one-stop method for all of your asset caching needs. This should be the first thing that you call. It checks to see if the page is looking for a cached asset. If it is, then it will return a response that you can $page->send(). If not, then just continue on your merry way. When you $page->display() your html, it will look for all of your assets, and convert them to cached urls.

Installation

Add the following to your composer.json file.

{
    "require ": {
        "bootpress/asset": "^1.0"
    }
}

Example Usage

<?php

use BootPress\Page\Component as Page;
use BootPress\Asset\Component as Asset;

$page = Page::html();
if ($asset = Asset::cached('assets')) {
    $page->send($asset);
}

$html = $page->display('<p>Content</p>');
$page->send(Asset::dispatch('html', $html));

License

The MIT License (MIT). Please see License File for more information.