![]() |
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 few steps to set up this example are detailed in AFS search 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_lightweight_example.php
Necessary templates are detailled in following link: PHP templates in details
Provided example is composed of about 10 lines of PHP code. About half of these lines are related to Twig template engine. 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!