vssl / render
Rendering agent for Journey Group’s Vessel Pages.
6.8.9
2025-04-10 20:45 UTC
Requires
- php: ^8.3
- guzzlehttp/guzzle: ^6.5
- guzzlehttp/promises: ^1.4
- guzzlehttp/psr7: ^1.7
- journey/cache: ^1.1
- league/plates: ^3.3
- psr/http-message: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- phpunit/phpunit: ^10.4
- dev-main
- 6.8.9
- 6.8.8
- 6.8.7
- 6.8.6
- 6.8.5
- 6.8.4
- 6.8.3
- 6.8.2
- 6.8.1
- 6.8.0
- 6.7.0
- 6.6.3
- 6.6.2
- 6.6.1
- 6.6.0
- 6.5.0
- 6.4.0
- 6.3.0
- 6.2.0
- 6.1.0
- 6.0.0
- 5.4.0
- 5.3.0
- 5.2.0
- 5.1.0
- 5.0.0
- 4.5.1
- 4.5.0
- 4.4.0
- 4.3.1
- 4.3.0
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.0
- 3.0.1
- 3.0.0
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.0
- dev-feat/trumba-embed-stripe
- dev-fix/menu-stripe
- dev-feat/reference-list-stripe
This package is auto-updated.
Last update: 2025-04-10 20:46:08 UTC
README
What
This package contains a PHP rendering agent for Vessel Pages. It includes a PSR-15 middleware implementation to easily attach to any conforming framework and will automatically consume the Vessel Pages API and render production-ready markup.
Configuration
use Vssl\Resolver; use Journey\Cache\LocalAdapter; $config = [ 'cache' => new LocalAdapter('/tmp') ]; Resolver::config($config); // for manual instantiation, you can also pass in a configuration. $resolver = new Resolver($request, $config);
Configuration options
The only required configuration option is an implementation of
Journey\Cache\CacheAdapterInterface
.
Option | Description |
---|---|
cache |
Instance of Journey\Cache\CacheAdapterInterface (or null to disable) |
cache_ttl |
Integer, number of seconds to store in cache |
base_uri |
URI for Vessel API interaction |
base_path |
Path to add to base_uri for versioned Vessel API interaction |
required_fields |
Keys required for API data to be considered valid |
templates |
Additional directory to find custom render templates |
How
Attach the middleware to your favorite PSR-15 dispatcher
before your router. When the request arrives in your controller methods, it will
have an attribute vssl-page
with content ready to be rendered.
<?php namespace App\Controllers; class YourController { /** * Any controller method. */ public function anypage(ServerRequestInterface $request) { $page = $request->getAttribute('vssl-page'); } }