ArtiGrid
Fields Arrange
This example demonstrates how to organize and control the layout of form fields in ArtiGrid using the
fields_arrange() method.
With this feature, you can group fields, define their order, and optionally display them inside a responsive Bootstrap row layout for a cleaner and more structured form design.
Each group accepts a list of fields, an optional title, and layout options. You can also choose whether to display the group title or keep the layout without any visual heading.
Fields are rendered exactly in the order defined. Any fields not included in a group will be automatically appended at the end of the form, ensuring full compatibility without additional configuration.
This functionality is ideal for building complex forms, allowing you to improve readability, maintain a clean UI, and control structure without writing custom HTML.
<?php
$grid = new ArtiGrid();
$grid->table('consultation')
->template('bootstrap5')
->unset('filter', false)
->required(false)
->fields_arrange('name,date,office', 'Group 1 - Names', true, false)
->fields_arrange('manager,country', 'Group 2 - Names', true)
->fields_arrange('region,city', 'Group 3 - Names', true)
->validation_required([
'name',
'country'
])
->modal();
echo $grid->render('insert');
?>