PHP code example of valksystems / bootbuilder

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

    

valksystems / bootbuilder example snippets


$form = BootBuilder::open();

// Horizontal Form
$horizontal = BootBuilder::openHorizontal();

setAction($action) // Set the action attribute
setClass($class) // set class (this will replace current class)
setId($id) // set the id of the form
setMethod($method) // set the method, either get or post

$form->add($control);

// Or when adding multiple controls/panes at the same time:
$form->addAll($pane1, $control, $submit);

$horizontal->setLabelCol($label_col) // for example col-md-3
$horizontal->setControlCol($control_col) // for example col-md-9

use \bootbuilder\Controls\Text;

$text = new Text("name");
// Or you can directly give it a label, ID and value with the optional constructor parameters
$text = new Text("name", "Please enter your name", "name_id", "Current Name");

setId($id) // set the id of the control tag (<input>/<select>/etc)
setClass($class), addClass($class), removeClass($class) // Edit the current class(es)
setValue($value) // set the value of the control. (not filtered!!)
setPlaceholder($placeholder) // set the placeholder
setLabel($labeltext) // set the label text, for using when rendering in a supported form
setRequired($

$options = array("key_value" => "Key Value");
setOptions($options);

$pane = new StackPane("Label Here");
$pane->addControl($control);

$form->add($pane);