![]() |
Antidot PHP API
version 0.16.0
##PHP API to simplify integration of Antidot components
|
In order to test this example, some components are required. Details are provided in following link: Prerequisites for integration examples with PHP template engine
Most of the steps to set up this example are detailed in AFS search query coder/decoder API, AFS search query API and AFS search reply API.
Here focus is given on missing steps in order to make the example fully functional.
It should be the first step. Antidot PHP API should be loaded from PHP example script. It is not necessary to load each PHP script as one main script does it for you:
Then Twig should also be loaded and initialized. Depending on your installation choices, following example may be modified to reflect your installation paths:
This is the last step.
Main Twig template is loaded with appropriate parameters and then rendered:
This code brevity is obtained thanks to special array formatting of reply helpers (see AfsHelperFormat::ARRAYS).
The full example is also available here: full_example.php
Various templates are detailled in following link: PHP templates in details
Provided example is composed of about 28 lines of PHP code. About third of these lines are related to facet configuration. So in few PHP code lines and some PHP templates, you can get a fully functional Web interface for your Antidot search service.
Modify this example and templates then test on your own service!