PHP code example of dose / feature

1. Go to this page and download the library: Download dose/feature 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/ */

    

dose / feature example snippets


$feature->getVariant($name);

getEntity($name);

$entity->addVariant($name, $odds)

switch $feature->getVariant($name) {
    case 'foo':
        // do stuff appropriate for the foo variant
        break;
    case 'bar':
        // do stuff appropriate for the bar variant
        break;
    case null:
        // feature is not enabled
        break;
}

if ($feature->getVariant($name)) {
    // Feature is enabled as long as variant evaluates to true
}