PHP code example of syntro / silverstripe-bootstrap-forms

1. Go to this page and download the library: Download syntro/silverstripe-bootstrap-forms 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/ */

    

syntro / silverstripe-bootstrap-forms example snippets


use Syntro\SilverstripeBootstrapForms\Forms\CheckboxField;
use Syntro\SilverstripeBootstrapForms\Forms\CheckboxSetField;
use Syntro\SilverstripeBootstrapForms\Forms\DropdownField;
use Syntro\SilverstripeBootstrapForms\Forms\EmailField;
use Syntro\SilverstripeBootstrapForms\Forms\OptionsetField;
use Syntro\SilverstripeBootstrapForms\Forms\TextareaField;
use Syntro\SilverstripeBootstrapForms\Forms\TextField;

// does not have the HolderClass trait
use Syntro\SilverstripeBootstrapForms\Forms\FieldGroup;

FieldGroup::create(
    TextField::create('Name', 'Your Name')->addHolderClass('col'),
    EmailField::create('Email', 'Email')->addHolderClass('col'),
    DropdownField::create(
        'choose',
        'Choose an option',
        [
            'yes' => 'Yes',
            'no' => 'No'
        ]
    )->addHolderClass('col'),
)->addExtraClass('row row-cols-1 row-cols-md-3'),