Use this guide for validation-aware forms, input groups, feedback blocks, and table rendering.
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\FormCell::class, [
'action' => '/contact',
'items' => [
['label' => 'Name', 'id' => 'contactName', 'name' => 'name'],
['type' => 'textarea', 'label' => 'Message', 'id' => 'contactMessage'],
['type' => 'submit', 'label' => 'Send'],
],
]) ?>Supported parameters:
action: form action URLmethod: form method, defaults topostitems: form fields usingtype,label,id,name,value,help,classes, and moreclasses: additional CSS classes on the<form>id: optional form idenctype: optional form enctype likemultipart/form-datanovalidate: adds thenovalidateattributevalidated: adds.was-validatedon the<form>autocomplete: optional form autocomplete valuedisabled: wraps all controls in a disabled<fieldset>escape: escapes labels, help text, and values by default; set tofalseto render trusted HTML
Supported item types:
input: default text-like input, withinputTypeforemail,password,file, and moretextarea: textarea control with optionalrowsselect: select control withoptionscheckbox: Bootstrap checkboxradio: Bootstrap radioswitch: Bootstrap switchhidden: hidden input without wrapper markupbutton,submit,reset: Bootstrap button actions
Useful item options:
floating: wrapsinput,textarea, orselectinside.form-floatingstate:validorinvalidvalidFeedback: renders.valid-feedbackinvalidFeedback: renders.invalid-feedbackhelp: renders.form-textcolumn: shorthand like6,12,md-6, orautocolumnClasses: explicit Bootstrap column classes likecol-md-6inline: renders inline checkboxes or radiosreverse: renders checks or radios with.form-check-reversewrapperClasses,labelClasses,helpClasses,validFeedbackClasses,invalidFeedbackClasses: customize wrappers and feedback classes
For more advanced layouts, combine classes="row g-3" on the form with column or columnClasses on each field item.
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\InputGroupCell::class, [
'items' => [
['type' => 'text', 'content' => '@'],
['type' => 'input', 'name' => 'username', 'placeholder' => 'Username'],
],
]) ?>Supported parameters:
items: ordered segments for the groupsize:smorlgclasses: additional CSS classes on the.input-groupid: optional group idescape: escapes text content and option labels by default; set tofalseto render trusted HTML
Supported item types:
text,addon,label: render.input-group-textinput: render a.form-controlinput withinputTypetextarea: render a.form-controltextareaselect: render a.form-selectwithoptionscheckbox,radio: render check controls inside.input-group-textbutton: render a Bootstrap button segment
Useful item options:
floating: wrapsinput,textarea, orselectinside.form-floatinglabel: floating label text for wrapped controlsstate:validorinvalidvalidFeedback: renders.valid-feedbackinvalidFeedback: renders.invalid-feedbackwrapperClasses,labelClasses,validFeedbackClasses,invalidFeedbackClasses: customize wrappers and feedback blocks
When validation is used on one or more items, InputGroupCell automatically adds .has-validation to the group wrapper.
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\ValidationCell::class, [
'message' => 'Please provide a valid city.',
]) ?>Supported parameters:
message: alias ofcontentcontent: feedback contentstate:validorinvalid, defaults toinvalidtype: alias ofstatetooltip: switches from*-feedbackto*-tooltipclasses: additional CSS classes on the feedback blockid: optional explicit idescape: escapes content by default; set tofalseto render trusted HTML
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\TableCell::class, [
'headers' => ['#', 'Name', 'Email'],
'rows' => [
[
['tag' => 'th', 'content' => '1'],
'Jane Doe',
'jane@example.com',
],
],
]) ?>Supported parameters:
headers: header cells as strings or arrays usinglabel,scope, andclassesrows: body rows as arrays of values, cell arrays usingcontent,tag,scope, andclasses, or structured rows usingcells,actions, andclassesfooter: optional footer row cellscaption: optional table captioncaptionTop: renders.caption-topvariant: contextual table variant likedark,primary, orsuccessstriped,stripedColumns,hover,bordered,borderless,small: Bootstrap table modifiersresponsive: wraps the table in.table-responsiveresponsiveBreakpoint: breakpoint suffix likesm,md, orlgstacked: addsdata-labelhooks and helper classes for stacked mobile table patternsstackedBreakpoint: breakpoint suffix for the stacked helper wrapperemptyMessage: message shown when there are no rowsemptyClasses: classes on the empty-state cellactionsHeader: header label for row actions, defaults toActionsactionsCellClasses: classes on generated action cellsclasses: additional CSS classes on the<table>wrapperClasses: additional CSS classes on the responsive wrapperheadVariant:lightordarkfor<thead>escape: escapes header and cell content by default; set tofalseto render trusted HTML
Structured rows may also define:
cells: ordered row cellsactions: action buttons rendered in a dedicated actions columnclasses: classes applied to the<tr>