Skip to Content
FrontendCrud V2Crud GeneratorGenerator v2Entity Interfaces & Template

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

KeyPHP InterfaceWhat it enables on the frontend
treeviewNestedEntityInterfaceTreeview listing mode, tree-up/tree-down actions, hierarchy columns (lvl, lft, rgt)
translatableTranslatableInterfaceLanguage tab in forms, translatable filter options
taggableTaggableTag filter chip, tag sidebox
deleteableSoftDeleteabledeletedAt field, restore action, deleted-at filter
slugableSluggableSlug field auto-populated from name
kvsDefaultValuesDefaultable”Set as default” action on listing/show
timestampableTimestampablecreatedAt / updatedAt tracking
disableableDisableableDisable action, disabledAt field, enabled filter
stringableStringabletoString virtual field shown in listing
printablePrintablePrint action on show page
emailableEmailableEmail-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

TokenReplaced 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 config

These are imported directly in your Next.js page files:

import { listingProps, createProps, editProps, showProps } from "@/crud_config/my_entity";
Last updated on