PHP code example of wbraganca / yii2-enumerables

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

    

wbraganca / yii2-enumerables example snippets


php composer.phar 

use wbraganca\enumerables\EnumBoolean;

var_dump(EnumBoolean::getConstList());
array(2) {
    [0] => string(2) "No"
    [1] => string(3) "Yes"
}

EnumBoolean::getConstList('Inactive', 'Active');
array(2) {
    [0] => string(8) "Inactive"
    [1] => string(6) "Active"
}