The Categories
The groups mentioned in the previous page are grouped into categories.
The order of categories defined in the back end will be preserved in the front end.
Below is an example of a complete Trio definition for a simple module:
php
namespace App\Services\App\Module\Specific\Locus;
class LocusInitDetails implements InitDetailsInterface
{
public static function modelGroups(): array
{
return [
'Season' => [
'code' => 'RV',
'source' => ['module' => 'Season', 'field' => 'id'],
'field_name' => 'season_id',
'manipulator' => function ($val) {
return (string) ($val + 10);
},
],
'Area' => [
'code' => 'RV',
'source' => ['module' => 'Area', 'field' => 'id'],
'field_name' => 'area_id',
],
'Search Description' => [
'code' => 'SF',
'field_name' => 'description',
],
'Search Registration Notes' => [
'code' => 'SF',
'field_name' => 'description',
],
'Square' => [
'code' => 'TM',
'dependency' => [],
'multiple' => true,
],
'Order By' => [
'code' => 'OB',
'options' => ['Season', 'Area', 'Locus No.'],
],
];
}
public static function categories(): array
{
return [
'Registration' => [
'Season',
'Area',
'Media',
'Square',
],
'Search' => [
'Search Description',
'Search Registration Notes',
],
'Order By' => [
'Order By',
],
];
}
}
The Categories (and Trio) structure are defined in module-specific configuartion files.
WARNING
Dependent Groups (and Categories) should always be placed after their dependencies!