UserFrosting API

SlimServeAsset

Asset server for applications using Slim. Intended for development scenarios.

Requires an instance of AssetLoader to handle loading assets from filesystem or remote source.

Tags
author

Alex Weissman (https://alexanderweissman.com)

author

Jordan Mele

Table of Contents

$assetLoader AssetLoader
__construct() Constructor. mixed
serveAsset() Reverses prefix transformations, locates asset via locator and adds asset content to response. mixed

Properties

Methods

serveAsset()

Reverses prefix transformations, locates asset via locator and adds asset content to response.

public serveAsset( $request : RequestInterface , $response : ResponseInterface , $args : array ) : mixed

On failure, sets response status code to 404. To use, simply hook up to routing with the necessary relative url passed through at 'url'. NOTE: PHP is very inefficent when it comes to serving static assets, and as such this is only recommended for testing purposes.

Parameters
$request : RequestInterface
$response : ResponseInterface
$args : array
Return values
mixed

Search results