Skip to content
forked from Kylob/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.

License

Notifications You must be signed in to change notification settings

sudovietcsudoers/Asset

 
 

Repository files navigation

use BootPress\Asset\Component as Asset;

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.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 86.9%
  • CSS 7.9%
  • JavaScript 5.2%