Download the PHP package hawkbit/presentation without Composer
On this page you can find all versions of the php package hawkbit/presentation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hawkbit/presentation
More information about hawkbit/presentation
Files in hawkbit/presentation
Package presentation
Short Description Presentation layer for Hawkbit PSR-7 Micro PHP framework
License MIT
Homepage https://github.com/HawkBitPhP
Informations about the package presentation
Hawkbit Presentation
Ployglott and extensible presentation layer for different presentation engines.
The presentation layer uses league/plates
as default engine and could be extended with Twig,
Smarty, Liquid, Blade and further more.
Install
Using Composer
Hawkbit Presentation is available on Packagist and can be installed using Composer. This can be done by running the following command or by updating your composer.json
file.
composer.json
Be sure to also include your Composer autoload file in your project:
Downloading .zip file
This project is also available for download as a .zip
file on GitHub. Visit the releases page, select the version you want, and click the "Source code (zip)" download button.
Requirements
The following versions of PHP are supported by this version.
- PHP 5.5
- PHP 5.6
- PHP 7.0
- PHP 7.1
- HHVM
In addition to PHP you also need a valid PSR-7 and PSR-11 integration.
Hawkbit Micro Framework is supported by default.
Silex, Lumen, zend-expressive and Slim support is untested but should work as well.
Setup
Setup with an existing application configuration (we refer to tests/assets/config.php)
Presentation from Hawbit Application
Presentation in a Hawkbit controller
Access a presentation service in controller. Hawkbit inject classes to controllers by default.
Access and extend engine
In some cases you would like to extend or access plates. We recommend to extend plates at a central point of your application like bootstrap or even better in your project service provider.
Wrap into PSR 7
Hawkbit presentation provides a PSR-7 Wrapper to capture rendered output into psr 7 response.
Please keep in mind to add an additional PSR-7 implementation!
You just need to wrap you favorite presentation adapter into psr 7 adapter
The integrations works with examples mentioned above
Rendering
Please keep in mind, that the render method is now returning an instance of \Psr\Http\Message\ResponseInterface
instead of a string!
Your presentation logic e. g. in a controller is now reduced as follows
Add response on render
Response class is attached while rendering by default. But in some cases you need to add your own response class just before rendering. The wrappers render method takes optional response as a third argument.
You are now able to render a different view e.g. $presentationService->render('acme::index')
and use a view helper function within an view (template).
Plates
Please refer to plates documentation for more details.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of presentation with dependencies
league/plates Version ~3.0
psr/container Version ~1.0
psr/http-message Version ~1.0