Documentation | Element CMF

Fields

You do not have to write any code to work with standard fields, you just need to specify a match for a column and field in the settings

Setting

Field structure

All fields are located in /app/fields/ folder, each within its own folder. And they have the following architecture

/controllers/       # Folder with controllers, optional folder
/models/            # Folder with models, optional folder
EmCheckField.php    # Major file, processing all field events
info.json           # Name

The frontend for the standard fields is kept in the folder /vue/src/components/fields/

Field frontend

The Field.vue component receives 4 attributes: fieldValue, fieldSettings, mode, and view

fieldValue

Current value

fieldSettings

Field settings: a compound array of mandatory attributes and settings from the settings form

{
    primaryKey{
        value     : <key value>,
        fieldCode : <key field>
    }
    fieldCode  = <code of the field/column>;
    tableCode  = <table code>
    ...
    other customized parameters for the field
}

mode

Field operation mode is editing/reading/editing with immediate saving

view

The display code which returns the field now has only two options