1. Go to this page and download the library: Download rikochey/rikochey-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rikochey / rikochey-php example snippets
use Rikochey\Client;
$client = new Client('42|pQ7d…', 'https://www.rikochey.com');
foreach ($client->websites()->all() as $website) {
$forms = $client->websites()->forms($website->id);
echo $website->name.': '.count($forms).' forms'.PHP_EOL;
}
$forms = $client->websites()->forms($website->id);
echo $forms->scriptTag(); // <script src="…" defer></script>, on every page
echo $forms->find('contact')?->embedTag(); // <div data-rikochey-form="contact"></div>
$submission = $client->submissions()->submit($website->id, 'contact', [
'name' => 'Smith',
'email' => '[email protected]',
'message' => 'Hello, I would like a quote.',
]);
echo $submission->message; // the confirmation message of the form
use Rikochey\Exception\ValidationException;
try {
$client->submissions()->submit($website->id, 'contact', $fields);
} catch (ValidationException $exception) {
$exception->errors(); // ['email' => ['The email field must be a valid email address.']]
}
$client = new Client($key, 'https://www.rikochey.com', new MyFrameworkTransport());
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.