PHP 클래스 MiniAsset\Middleware\AssetMiddleware

This provides a development grade middleware component that can serve the assets that mini-asset could build. This component is *not* recommended for production as it will be much slower than serving the static files generated by the CLI tool.
파일 보기 프로젝트 열기: markstory/mini-asset

공개 메소드들

메소드 설명
__construct ( AssetConfig $config, string $outputDir = null, string $urlPrefix = '/asset/' ) Constructor.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Apply the asset middleware.

비공개 메소드들

메소드 설명
mapType ( $ext )
respond ( $response, $contents, $ext )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( AssetConfig $config, string $outputDir = null, string $urlPrefix = '/asset/' )
$config MiniAsset\AssetConfig The config instance for your application.
$outputDir string The directory development build caches should be stored in. Defaults to sys_get_temp_dir().
$urlPrefix string The URL prefix that assets are under. Defaults to /asset/.

__invoke() 공개 메소드

Apply the asset middleware.
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface The request.
$response Psr\Http\Message\ResponseInterface The response.
$next callable The callable to invoke the next middleware layer.
리턴 Psr\Http\Message\ResponseInterface A response.