Use this guide for foundational Bootstrap Cells and simple data display components.
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\AlertCell::class, [
'message' => 'Profile updated successfully.',
'variant' => 'success',
]) ?>Supported parameters:
message: alias ofcontentfor simple text alertscontent: alert body contentheading: optional.alert-headingvariant: Bootstrap contextual variant likeprimary,success,warning,dangertype: alias ofvariantdismissible: adds the close button and Bootstrap dismissal classesescape: escapesheadingandcontentby default; set tofalseto render trusted HTMLclasses: additional CSS classes on the wrapperrole: ARIA role, defaults toalertcloseLabel: accessible label for the dismiss button, defaults toClose
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\BadgeCell::class, [
'content' => '99+',
'variant' => 'danger',
'pill' => true,
]) ?>Supported parameters:
message: alias ofcontentcontent: badge contentvariant: Bootstrap contextual variant likeprimary,secondary,success,dangertype: alias ofvariantpill: adds the.rounded-pillutility classclasses: additional CSS classes on the badgeescape: escapescontentandhiddenTextby default; set tofalseto render trusted HTMLhiddenText: optional visually hidden text for accessibility
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\ButtonCell::class, [
'content' => 'View profile',
'href' => '/profile',
'variant' => 'secondary',
'outline' => true,
]) ?>Supported parameters:
message: alias ofcontentcontent: button label/contentvariant: Bootstrap contextual variant likeprimary,secondary,success,dangertype: alias ofvariantoutline: switches from.btn-{variant}to.btn-outline-{variant}size:smorlghref: when set, renders an anchor buttontag: forcebuttonorabuttonType:typeattribute for<button>, defaults tobuttondisabled: disabled state for buttons and accessible disabled state for anchorsclasses: additional CSS classesescape: escapescontentby default; set tofalseto render trusted HTMLrole: optional explicit role
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\CardCell::class, [
'title' => 'Featured',
'content' => 'This is a wider card with supporting text.',
]) ?>Supported parameters:
message: alias ofcontentcontent: main card text rendered in.card-texttitle: optional.card-titlesubtitle: optional.card-subtitleheader: optional.card-headerfooter: optional.card-footerimage: optional image URLimageAlt: alt text for the imageimagePosition:toporbottomclasses: additional CSS classes on the card wrapperbodyClasses: additional CSS classes on.card-bodytitleTag: heading tag for the title, defaults toh5escape: escapes textual content by default; set tofalseto render trusted HTML
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\ImageCell::class, [
'src' => '/images/photo.jpg',
'alt' => 'Profile photo',
'thumbnail' => true,
'rounded' => true,
]) ?>Supported parameters:
src: image source URLimage: alias ofsrcalt: image alt textimageAlt: alias ofaltfluid: adds.img-fluid, enabled by defaultthumbnail: adds.img-thumbnailrounded:truefor.roundedor a custom rounded utility class likerounded-circlealign:start,end, orcenterclasses: additional CSS classes on the<img>attrs: additional<img>attributes such asloading,width,height, ordata-*sources: optional<source>definitions for wrapping the image in a<picture>element
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\FigureCell::class, [
'src' => '/images/photo.jpg',
'alt' => 'Profile photo',
'caption' => 'A caption for the above image.',
'captionAlign' => 'end',
]) ?>Supported parameters:
src: figure image source URLimage: alias ofsrcalt: image alt textimageAlt: alias ofaltcaption: figure caption textcontent: alias ofcaptionmessage: alias ofcaptionfluid: adds.img-fluidto the figure image, enabled by defaultthumbnail: adds.img-thumbnailto the figure imagerounded:truefor.roundedor a custom rounded utility class likerounded-circlecaptionAlign:start,center, orendclasses: additional CSS classes on the<figure>imageClasses: additional CSS classes on the<img>captionClasses: additional CSS classes on the<figcaption>attrs: additional<img>attributes such asloading,width,height, ordata-*sources: optional<source>definitions for wrapping the image in a<picture>elementescape: escapes caption content by default; set tofalseto render trusted HTML
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\ProgressCell::class, [
'value' => 25,
'label' => '25%',
]) ?>Supported parameters:
value: shorthand single progress valuelabel: shorthand single progress labelbars: array of bars usingvalue,label,variant,striped,animated, andclassesheight: optional inline heightclasses: additional CSS classes on the wrapperescape: escapes labels by default; set tofalseto render trusted HTML
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\SpinnerCell::class, [
'variant' => 'primary',
]) ?>Supported parameters:
type:borderorgrowvariant: optional contextual text color likeprimaryorsecondarysize:smfor the small spinner variantlabel: accessible loading label, defaults toLoading...classes: additional CSS classes
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\PlaceholderCell::class, [
'items' => [
['width' => 8],
['width' => 6, 'variant' => 'secondary'],
],
]) ?>Supported parameters:
items: placeholder rows usingwidth,variant,size, andclasseswidth: shorthand width for the single default placeholdervariant: optional background variant likeprimary,secondary, orsuccesssize:lg,sm, orxsanimation:gloworwaveclasses: additional CSS classes on the wrapperitemClasses: additional CSS classes on the single placeholder item
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\DescriptionListCell::class, [
'items' => [
['term' => 'Name', 'description' => 'Jane Doe'],
['term' => 'Role', 'description' => 'Admin'],
],
]) ?>Supported parameters:
items: list entries usingterm,description,termClasses, anddescriptionClassesclasses: additional classes on the<dl>row: adds Bootstrap.row, enabled by defaulttermClasses: default classes for<dt>, defaults tocol-sm-3descriptionClasses: default classes for<dd>, defaults tocol-sm-9escape: escapes terms and descriptions by default; set tofalseto render trusted HTML
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\StatsCardsCell::class, [
'items' => [
['label' => 'Users', 'value' => '128'],
['label' => 'Revenue', 'value' => '$4.2k', 'description' => 'This month'],
],
]) ?>Supported parameters:
items: cards usinglabel,value,description,meta,variant,columnClasses, andcardClassesclasses: wrapper classes, defaults torow g-3columnClasses: default classes for each item columncardClasses: default classes for each cardescape: escapes content by default; set tofalseto render trusted HTML
<?= view_cell(\domProjects\CodeIgniterBootstrap\Cells\EmptyStateCell::class, [
'title' => 'No projects',
'content' => 'Create your first project to get started.',
]) ?>Supported parameters:
title: heading text, defaults toNothing here yetcontent: description textmessage: alias ofcontentactions: optional action buttons usinglabel,href,variant, andclassesclasses: wrapper classesbodyClasses: classes on the inner content wrappermaxWidth: max-width style for the content wrapperescape: escapes content by default; set tofalseto render trusted HTML