<?php //================================================ // Create Form //================================================ $form = new form_too(); $form->attr('class', 'form-horizontal'); //--------------------------------- // Control Group #1 //--------------------------------- $form->start_div(array('class' => 'control-group')); $form->add_label('Email', array('class' => "control-label", 'for' => "inputEmail")); $form->start_div(array('class' => 'controls')); $txt_userid = new textbox('email', ''); $txt_userid->attrs(array('placeholder' => 'Email', 'id' => 'inputEmail')); $form->add_element($txt_userid); $form->end_div(); $form->end_div(); //--------------------------------- // Control Group #2 //--------------------------------- $form->start_div(array('class' => 'control-group')); $form->add_label('Password', array('class' => "control-label", 'for' => "inputPassword")); $form->start_div(array('class' => 'controls')); $txt_pass = new secret('password', ''); $txt_pass->attrs(array('placeholder' => 'Password', 'id' => 'inputPassword')); $form->add_element($txt_pass); $form->end_div(); $form->end_div(); //--------------------------------- // Control Group #3
<?php //================================================ // Create Form //================================================ $form = new form_too(); //--------------------------------------- // Form Label //--------------------------------------- $form->label('Test Form'); //--------------------------------------- // Add Hidden Variables //--------------------------------------- $form->add_hidden('test1', 1); $form->add_hidden('test2', 'Bob', array('class' => 'test_class')); //--------------------------------------- // Start Fieldset //--------------------------------------- $form->start_fieldset('Test', array('class' => 'fs_class'), array('class' => 'leg_class')); $form->add_label('Label name'); $form->add_element(input(array('type' => 'text', 'placeholder' => "Type something..."))); //--------------------------------------- // End Fieldset //--------------------------------------- $form->end_fieldset(); $form->add_element(span('Example block-level help text here.', array('class' => "help-block"))); $form->add_label(input(array('type' => 'checkbox')) . 'Check me out', array('class' => "checkbox")); $form->add_element(button('Submit', array('type' => "submit", 'class' => "btn"))); //--------------------------------------- // Triple Layered Divs //---------------------------------------
<?php //================================================ // Create Form //================================================ $form = new form_too(); $form->attr('class', 'form-inline'); $txt_userid = new textbox('email', ''); $txt_userid->attrs(array('placeholder' => 'Email', 'class' => 'input-small')); $form->add_element($txt_userid); $txt_pass = new secret('password', ''); $txt_pass->attrs(array('placeholder' => 'Password', 'class' => 'input-small')); $form->add_element($txt_pass); $form->add_label(input(array('type' => 'checkbox')) . 'Remember me', array('class' => "checkbox")); $form->add_element(button('Sign in', array('type' => "submit", 'class' => "btn"))); //================================================ // Render Form //================================================ $form->render();
<?php //================================================ // Create Form //================================================ $form = new form_too(); $form->attr('class', 'form-search'); $form->add_element(input(array('type' => 'text', 'placeholder' => "Search", 'class' => 'input-medium search-query'))); $form->add_element(button('Search', array('type' => "submit", 'class' => "btn"))); //================================================ // Render Form //================================================ $form->render();
<?php //================================================ // Create Form //================================================ $form = new form_too(); // Form Label $form->label('Legend'); // Add Elements / Labels $form->add_label('Label name'); $form->add_element(input(array('type' => 'text', 'placeholder' => "Type something..."))); $form->add_element(span('Example block-level help text here.', array('class' => "help-block"))); $form->add_label(input(array('type' => 'checkbox')) . 'Check me out', array('class' => "checkbox")); $form->add_element(button('Submit', array('type' => "submit", 'class' => "btn"))); //================================================ // Render Form //================================================ $form->render();