Download the PHP package ritson/placid-statamic without Composer
On this page you can find all versions of the php package ritson/placid-statamic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ritson/placid-statamic
More information about ritson/placid-statamic
Files in ritson/placid-statamic
Package placid-statamic
Short Description Consume RESTful APIs in your Statamic templates
License MIT
Informations about the package placid-statamic
Placid Statamic
Placid allows you to consume RESTful APIs in your Statamic templates, using Guzzle to handle the requests.
Placid supports:
- Caching/Refreshing
- Template variable pairs
- Predefined requests
- Headers
- Access tokens
Installation
Require the addon via composer
Parameters
- host: The API host
- cache (number): The time in seconds until the cache refreshes (default is 7200 / 2 hours)
- handle (string) : The handle of the resource to use
- method (string) : You can set which method to use on the request, default is 'GET'
- query (string) : Add your queries here, see queries for more info
- path (string) : Add your own custom path, see paths for details
- auth (string) : Handle for the auth scheme to use
Saved requests
You can set up requests for placid in resources/placid/requests like so:
Authentication
You can define authorisation schemes to use and reuse on your requests. You define them in resources/placid/auth like so:
The above will send the token through the headers, you define your tokens in your config and reference as you would any Laravel config item.
If you need to send your access token through the query string, define your auth scheme like so:
The query string and headers will be merged with any that are already present on the request
Usage
To use this plugin in your templates, simply use these tags:
Basic example
Full example
Support,issues,feedback
If you want to leave feedback about this project, feel free to get in touch on twitter if you experience any issues please just create a new issue here on the Repo