Skip to content
Example project ( in zend expressive ) which integrates psr7-asset and psr7-asset-example ( module )
PHP HTML ApacheConf
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
config
data
public
src/App
templates
test/AppTest/Action
.gitignore
LICENSE
README.md
composer.json
composer.lock
phpcs.xml
phpunit.xml.dist

README.md

psr7-asset-example-zendexpressive

Example project ( in zend expressive ) which integrates psr7-asset and psr7-asset-example ( module )

Installation

git clone https://github.com/harikt/psr7-asset-example-zendexpressive.git
cd psr7-asset-example-zendexpressive
composer install

Experiment yourself with the Hkt\Psr7Asset\AssetLocator to change / serve different images.

Example :

<?php
// src/App/Config/Common.php
$assetLocator = $di->get('Hkt\Psr7Asset\AssetLocator');
$rootPath = dirname(dirname(dirname(__DIR__)));
$assetLocator->set('hkt/psr7-asset-example/images/white-image.png', $rootPath . '/public/psr7-asset-example/white-image.png');

Caching Assets

Assets from different vendor/package can be cached to the document root, so it can be served by the server.

php bin/console.php hkt:psr7-asset:cache ./public
You can’t perform that action at this time.