ArtiGrid
Row Template
The setRowTemplate() method allows you to completely customize how each row is rendered.
You can use any HTML structure and include dynamic field placeholders such as {customerNumber}, {checkNumber}, and {amount}. The {actions} placeholder is automatically replaced with the configured row action buttons.
Since the template supports Bootstrap grid classes, you can easily control the number of columns and create responsive layouts. For example, col-md-3 displays four cards per row, while col-md-4 displays three cards per row.
<?php
$grid = new ArtiGrid();
$grid->table('gallery')
->template('bootstrap5')
->required(true)
->modal()
->perPage(12)
->setRowTemplate('
<div class="col-md-3">
<div class="card h-100 shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">
<span>
{title}
</span>
{checkbox}
</div>
<div class="card-body">
<p>
{image}
</p>
{actions}
</div>
</div>
</div>
');
echo $grid->render();
?>