Form title

$form = new Barebone\Form();
	    
$form->is_ajax();
if($form->is_send() && !$form->is_valid()){
    $this->ShowZebraDialog('Error', 'Your form has an invalid seckey', 'error');
}

if($form->is_send() && $form->is_valid()){
    $this->ShowModal('You send this data:', '<pre>'.print_r($_POST, true).'</pre>');
}
$form->secure_form();

$form->addInput('text', 'ID', 'id', ['disabled' => 'disabled', 'class' => 'form-control']);
$form->addInput('text', 'Name', 'name', ['class' => 'form-control']);
$form->addInput('text', 'State', 'state', ['class' => 'form-control']);

$options = [];
$options[0] = 'No choice made';
$options[1] = '1 choice made';
$options[2] = '2 choice made';
$form->addSelect(
    label: 'Choices', 
    name:'choices', 
    attributes: ['class' => 'form-control'], 
    options: $options
);
$form->addButton('submit', 'Save', ['class'=>'btn btn-success', 'style'=>'margin-top: 20px;margin-left: 15px;']);
$this->view->form = $form;
  • Barebone\Form

    Barebone\Form extends Barebone\Component
    • [P] $form : Element
    • [M] __construct( $attributes ) : void
    • [M] secure_form() : void
    • [M] panelize( Barebone\Form $form, string $title, string $footer ) : Barebone\Form\Element
    • [M] create_csfr_token() : void
    • [M] is_valid_csfr() : bool
    • [M] is_send() : bool
    • [M] is_valid() : bool
    • [M] is_ajax() : void
    • [M] is_multipart() : void
    • [M] flash( string $message, string $type ) : void
    • [M] add( Barebone\Form\Element $element ) : void
    • [M] addButton( $type, $value, $attributes ) : void
    • [M] addInput( $type, $label, $name, $attributes ) : void
    • [M] addRadioGroup( $label, $name, $options, $attributes ) : void
    • [M] addTextarea( $label, $name, $attributes ) : void
    • [M] addCheckbox( $label, $name, $value, $attributes ) : void
    • [M] addHidden( $name, $value, $attributes ) : void
    • [M] addSelect( string $name, string $label, array $attributes, array $options ) : void
    • [M] get_input_type_from_db_type( $propertie ) : void
    • [M] get_json() : void
    • [M] get_html() : void
    • [M] render() : void
    • [M] get_csrf() : void
    • Barebone\Component

      Barebone\Component
      • [P] $properties : array
      • [M] __construct( mixed $data ) : void
      • [M] setData( mixed $data ) : void
      • [M] toArray() : array
      • [M] debug( mixed $data, bool $vardump, $cls_pre ) : void
      • [M] __set( string $name, mixed $value ) : void
      • [M] __get( string $name ) : void
      • [M] __isset( string $name ) : void
      • [M] sanitize_array( array $data ) : void