PHP code example of 2amigos / yii2-bootstrap-form-helpers-library

1. Go to this page and download the library: Download 2amigos/yii2-bootstrap-form-helpers-library 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/ */

    

2amigos / yii2-bootstrap-form-helpers-library example snippets


// using Select Widget, the custom select HTML element of the library

dosamigos\formhelpers\Select::widget([
    'model' => $model,
    'attribute' => 'attributeName',
    'items' => [
        '1' => 'One option',
        '2' => 'Another option'
    ],
    // for all possible client options, please see
    // http://bootstrapformhelpers.com/select/#jquery-plugins
    'clientOptions' => [
        'filter' => 'true' // boolean must be as a string
    ]
]);

// using the NumberInput
dosamigos\formhelpers\NumberInput::widget([
    'model' => $model,
    'attribute' => 'updated_at',
    // not ,
    'language' => 'es_ES',
    'clientOptions' => [
        'format' => 'm/d/y',
    ]
]);

// using the CurrencyPicker with flags
dosamigos\formhelpers\CurrencyPicker::widget([
    'model' => $model,
    'attribute' => 'updated_at',
    // important! if we don't use the custom select HTML we won't see the flags
    'selectBox' => true,
    'clientOptions' => [
        'flags' => 'true',
    ]
])


php composer.phar