Entity Interfaces & Config Template
Entity Interfaces
The generator reads which PHP interfaces an entity implements and outputs an implementedInterfaces map. The frontend CRUD components use this to conditionally enable features.
Interface Map
| Key | PHP Interface | What it enables on the frontend |
|---|---|---|
treeview | NestedEntityInterface | Treeview listing mode, tree-up/tree-down actions, hierarchy columns (lvl, lft, rgt) |
translatable | TranslatableInterface | Language tab in forms, translatable filter options |
taggable | Taggable | Tag filter chip, tag sidebox |
deleteable | SoftDeleteable | deletedAt field, restore action, deleted-at filter |
slugable | Sluggable | Slug field auto-populated from name |
kvsDefaultValues | Defaultable | ”Set as default” action on listing/show |
timestampable | Timestampable | createdAt / updatedAt tracking |
disableable | Disableable | Disable action, disabledAt field, enabled filter |
stringable | Stringable | toString virtual field shown in listing |
printable | Printable | Print action on show page |
emailable | Emailable | Email-template action on show page |
Example Output in index.tsx
const implementedInterfaces = {
treeview: false,
translatable: false,
taggable: true,
deleteable: true,
slugable: true,
kvsDefaultValues: true,
timestampable: true,
disableable: true,
stringable: true,
printable: true,
emailable: false,
};Interface detection is automatic — the generator reads the entity’s interface list from the API metadata. You do not configure this in changes.json.
Config Template & Tokens
config/config-template.tsx is the skeleton for every generated index.tsx. It contains typed TypeScript with [placeholder] tokens that the generator replaces at build time.
Placeholder Tokens
| Token | Replaced With |
|---|---|
[generationDate] | ISO timestamp of generation |
[importStatements] | Entity-specific imports (e.g. TableNames, PropertyTypes) |
[bundle] | Bundle name string, e.g. 'AccountingBundle' |
[unit] | Entity name string, e.g. 'Account' |
[resource] | API resource slug, e.g. 'accounting_accounts' |
[tableName] | Database table name, e.g. 'accounts' |
[fieldsExport] | Array of fields to include in CSV export |
[fieldsAll] | All available listing columns |
[selectedList] | Default-selected listing columns |
[defaultListingActions] | Default row actions on listing page |
[listingAllActions] | All possible listing row actions |
[kanbanListingAllActions] | Actions available in kanban view |
[treeviewListingAllActions] | Actions available in treeview |
[implementedInterfaces] | Interface capability map |
[defaultFilters] | Pre-applied filter values |
[formModalShowInputs] | Quick-view modal field configs |
[formModalEditInputs] | Quick-edit modal field configs |
[formModalAddInputs] | Quick-add modal field configs |
[mainColumns] | Listing column definitions |
[addFormInputs] | Full create/edit form field configs |
[addFilterFields] | Filter panel field configs |
[addSideBoxs] | Sidebox relationship configs |
[customActions] | Show-page custom action list |
[addDisplayFields] | Show-page field display configs |
[qfield] | Primary search field name |
Entity-Specific Imports
The [importStatements] token is replaced by AddImportStatements() in template-generator.js. For specific entities, extra imports are injected:
// StorageBundle/CustomProperty gets:
import { TableNames } from "../tableNames";
import { PropertyTypes } from "../propertyTypes";All other entities get an empty string for this token.
Generated Exports
Every index.tsx exports four typed prop objects consumed by the CRUD components:
export const listingProps: ListingProps // listing page config
export const createProps: CreateProps // create page config
export const editProps: EditProps // edit page config
export const showProps: ShowProps // show/detail page configThese are imported directly in your Next.js page files:
import { listingProps, createProps, editProps, showProps }
from "@/crud_config/my_entity";