"url"), leave url empty if no url //$breadcrumbs["New Crumb"] => "http://url.com" $breadcrumbs["Misc"] = ""; include("inc/ribbon.php"); ?>
start_track(); $data = json_decode(file_get_contents(APP_URL.'/data/data.json')); // SmartForm layout $fields = array( 'fname' => array( 'type' => 'input', // or FormField::FORM_FIELD_INPUT 'col' => 6, 'properties' => array( 'placeholder' => 'First name', 'icon' => 'fa-user', 'icon_append' => false ) ), 'lname' => array( 'type' => 'input', 'col' => 6, 'properties' => array( 'placeholder' => 'Last name', 'icon' => 'fa-user', 'icon_append' => false ) ), 'email' => array( 'type' => 'input', 'col' => 6, 'properties' => array( 'placeholder' => 'E-mail', 'icon' => 'fa-envelope', 'type' => 'email', 'icon_append' => false ) ), 'phone' => array( 'type' => 'input', 'col' => 6, 'properties' => array( 'placeholder' => 'Phone', 'icon' => 'fa-phone', 'type' => 'email', 'icon_append' => false ) ), 'country' => array( 'type' => 'select', 'col' => 5, 'properties' => array( 'data' => array( array('country' => 'Philippines'), array('country' => 'USA'), array('country' => 'Canada') ) ) ), 'city' => array( 'type' => 'input', 'col' => 4, 'properties' => array( 'placeholder' => 'City' ) ), 'zip' => array( 'type' => 'input', 'col' => 3, 'properties' => array( 'placeholder' => 'Post Code' ) ), 'address' => array( 'type' => 'input', 'properties' => 'Address' ), 'other-info' => array( 'type' => 'textarea', 'properties' => 'Additional Info' ), 'card' => array( 'type' => 'radio', 'properties' => array( 'items' => array(array('label' => 'Visa', 'checked' => true), 'MasterCard', 'American Express'), 'inline' => true ) ), 'name-on-card' => array( 'col' => 10, 'properties' => 'Name on card' ), 'cvv' => array( 'col' => 2, 'properties' => 'CVV2' ), 'card-label' => array( 'type' => 'label', 'col' => 4, 'properties' => 'Expiration Date' ), 'card-month' => array( 'type' => 'select', 'col' => 5, 'properties' => array( 'data' => array( array('month' => 'January'), array('month' => 'February'), array('month' => '...') ) ) ), 'card-year' => array( 'col' => 3, 'properties' => 'Year' ) ); $form = $_ui->create_smartform($fields); $form->options('method', 'post'); $form->fieldset(0, array('fname', 'lname', 'email', 'phone')); $form->fieldset(1, array('country', 'city', 'zip', 'address', 'other-info')); $form->fieldset(2, array('card', 'name-on-card', 'cvv', 'card-label', 'card-month', 'card-year')); $form->header('Automatic Layout Creation!'); $form->footer(function() use ($_ui) { $btn = $_ui->create_button('Submit', 'primary')->attr(array('type' => 'submit')); return $btn->print_html(true); }); $form->title('

Auto Layout

'); $result = $form->print_html(true); echo $result; // individual print field $body = '
Individual Print Fields (setup your own form HTML)
'.SmartForm::print_field('name', SmartForm::FORM_FIELD_INPUT, array( 'icon' => 'fa-user', 'tooltip' => 'Input name', 'placeholder' => 'Name', 'label' => 'Your Name', 'note' => 'Note: Type in something to autocomplete', 'autocomplete' => array( 'data' => $data, 'display' => 'Name', 'value' => 'Name' ) ), 6, true).' '.SmartForm::print_field('email', SmartForm::FORM_FIELD_INPUT, array( 'icon' => 'fa-envelope', 'tooltip' => 'This is a tooltip', 'type' => 'email', 'label' => 'Email Address', 'placeholder' => 'myemail@domain.com' ), 6, true).'
'.SmartForm::print_field('addr', SmartForm::FORM_FIELD_INPUT, 'Your Address (minimal setup)', 0, true).'
'.SmartForm::print_field('file', SmartForm::FORM_FIELD_FILEINPUT, null, 6, true).' '.SmartForm::print_field('select', SmartForm::FORM_FIELD_SELECT, array( 'data' => $data, 'value' => 'ID', 'display' => 'Name' ), 6, true).'
'.SmartForm::print_field('select', SmartForm::FORM_FIELD_MULTISELECT, array( 'data' => $data, 'value' => 'ID', 'display' => 'Name', 'label' => 'Multi Select' ), 6, true).'
'.SmartForm::print_field('textarea', SmartForm::FORM_FIELD_TEXTAREA, array( 'rows' => 4, 'label' => 'Textarea', 'type' => 'resizable' ), null, true).'
'.SmartForm::print_field('checkbox[]', SmartForm::FORM_FIELD_CHECKBOX, array( 'items' => array('This is a checkbox', 'checkbox two', array( 'name' => 'new-name', 'checked' => true, 'label' => 'A third checkbox', ), '4th Checkbox', '5th checkBox'), 'cols' => 3, 'label' => 'Collumned Checkboxes' ), null, true).' '.SmartForm::print_field('checkbox_inline[]', SmartForm::FORM_FIELD_CHECKBOX, array( 'items' => array('one', 'two', array( 'name' => 'new-name-inline', 'checked' => true, 'label' => 'three', ), 'four', 'six'), 'inline' => true, 'label' => 'Inline!' ), null, true).' '.SmartForm::print_field('solo', SmartForm::FORM_FIELD_CHECKBOX, 'One Checkbox only (minimal setup)', null, true).'
'.SmartForm::print_field('radio', SmartForm::FORM_FIELD_RADIO, array( 'items' => array('This is a Radio', 'Radio two', array( 'name' => 'new-name', 'checked' => true, 'label' => 'A third Radio', 'disabled' => true ), '4th Radio', '5th Radio'), 'cols' => 3, 'label' => 'Collumned Radios' ), null, true).' '.SmartForm::print_field('radio_inline', SmartForm::FORM_FIELD_RADIO, array( 'items' => array('one', 'two', array( 'name' => 'new-name-inline', 'checked' => true, 'label' => 'three', ), 'four', 'six'), 'inline' => true, 'label' => 'Inline!' ), null, true).' '.SmartForm::print_field('solo', SmartForm::FORM_FIELD_RADIO, 'One Radio only (minimal setup)', null, true).'
'.SmartForm::print_field('toggle_checkbox', SmartForm::FORM_FIELD_CHECKBOX, array( 'items' => array('Switch 1', 'Switch 2', 'Switch 3'), 'toggle' => true, 'label' => 'Checkbox Toggle' ), 6, true).' '.SmartForm::print_field('toggle_checkbox', SmartForm::FORM_FIELD_RADIO, array( 'items' => array('Switch 1', 'Switch 2', 'Switch 3'), 'toggle' => true, 'label' => 'Radio Toggle' ), 6, true).'
'.SmartForm::print_field('rating-star', SmartForm::FORM_FIELD_RATING, 10, null, true).' '.SmartForm::print_field('rating-star2', SmartForm::FORM_FIELD_RATING, array( 'max' => 8, 'icon' => 'fa-asterisk', 'label' => 'Rating', 'note' => 'Note: This is a customized rating field' ), null, true).'
'.SmartForm::print_field('rating-multiple', SmartForm::FORM_FIELD_RATINGS, array( 'items' => array( array( 'max' => 6, 'icon' => 'fa-trophy', 'label' => 'The Rating' ), 3, 7, 10, 20 ), 'label' => 'Multiple Ratings? No problem!' ), null, true).'
'.$_ui->create_button('Submit', 'primary')->container('button')->attr(array('type' => 'submit'))->print_html(true).'
'; $_ui->create_widget()->body('content', $body) ->options('editbutton', false) ->body('class', 'no-padding') ->header('title', '

SmartUI::SmartForm

')->print_html(); // print html output $run_time = $_ui->run_time(false); $hb = new HTMLIndent(); $html_snippet = SmartUtil::clean_html_string($hb->indent($body), false); $contents = array( "body" => '
'.$html_snippet.'
', "header" => array( "icon" => 'fa fa-code', "title" => '

HTML Output (Run Time: '.$run_time.')

' ) ); $options = array( "editbutton" => false, "colorbutton" => false, "collapsed" => true ); $_ui->create_widget($options, $contents)->color('pink')->print_html(); ?>
parse($md); echo str_replace('