PHP code example of floodgate / floodgate-cakephp
1. Go to this page and download the library: Download floodgate/floodgate-cakephp 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/ */
floodgate / floodgate-cakephp example snippets
// /config/app.php
'Floodgate' => [
'sdkkey' => 'enter-your-sdk-key'
],
// Controller/AppController.php
$this->loadComponent('FloodgateCake.FloodgateClient');
// /src/Controller/MyController.php
$result = $this->FloodgateClient->GetValue('feature-flag-key', false);
if ($result) {
// Do something new and exciting
}
else {
// Do whatever I usually do
}