Download the PHP package zpetr/apigility-htmlnegotiation without Composer
On this page you can find all versions of the php package zpetr/apigility-htmlnegotiation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download zpetr/apigility-htmlnegotiation
More information about zpetr/apigility-htmlnegotiation
Files in zpetr/apigility-htmlnegotiation
Download zpetr/apigility-htmlnegotiation
More information about zpetr/apigility-htmlnegotiation
Files in zpetr/apigility-htmlnegotiation
Vendor zpetr
Package apigility-htmlnegotiation
Short Description Apigility HtmlNegotiation module
License BSD
Homepage https://github.com/zpetr/apigility-htmlnegotiation
Package apigility-htmlnegotiation
Short Description Apigility HtmlNegotiation module
License BSD
Homepage https://github.com/zpetr/apigility-htmlnegotiation
Please rate this library. Is it a good library?
Informations about the package apigility-htmlnegotiation
apigility-htmlnegotiation
HtmlNegotiation module for Apigility.
Response type is based on Accept header :
- request that specifies text/html (or text/*+html) get the content in HTML
- application/hal+json (or application/*+json) request get the content in HalJson as usual.
Installation
Install composer in your project
curl -s http://getcomposer.org/installer | php
Define dependencies in your composer.json file
Finally install dependencies
php composer.phar install
or update it
php composer.phar update
Usage
-
Add zPetr\HtmlNegotiation to config/modules.config.php:
- Go to admin, select your API and change Content Negotiation Selector to HTML-HalJson
- Add text/html to Accept whitelist and Content-Type whitelist. Add other headers if needed.
- Save configuration
Templates
Layout
If you want to personalize custom layout template:
- Copy default zpetr/apigility-htmlnegotiation/view/layout.phtml template to the view folder of your module (why not to Application module)
- Add this to module config:
API response templates
To customize any API template:
- Create view folder in your API directory. For example, if you have API named Foo with REST service named Bar, create:
module/Foo/src/Foo/V1/Rest/Bar/view/
- Create get.phtml for Entity template and get_list.phtml for Collection template. You can use default ones from zpetr/apigility-htmlnegotiation/view/zf/rest/ folder.
All versions of apigility-htmlnegotiation with dependencies
PHP Build Version
Package Version
The package zpetr/apigility-htmlnegotiation contains the following files
Loading the files please wait ....