Edit Group
Edit existing user groups, including their name and active state, with application-specific permissions and additional fields.
Overview
Edit Group is a ready-to-use editing Core App. Unlike a generic document editor, it
understands the validation and persistence requirements of its specific document type. It uses
CoreUi\Form\FieldBuilder
to build the form and renders the existing document values on initial load.
The Core App resolves the requested document by ID, displays its editable fields, validates submitted values and updates the document. Invalid submissions return the form with field errors; successful updates return a success view.
Request and rendering flow
- Call
__invoke(ObjectId|string $objectId)with the existing document ID. - The Core App resolves its mapped collection and loads the document.
getFormData()supplies the field definitions and initial values toFieldBuilder.- The
edit()AJAX action receives and validates the submitted data. - On success,
editGroupDocument()updates the document; the response renders the success template.
The concrete application must enforce its own access and authorization requirements for editing documents.
Integrating the Core App
Extend CoreApp\Edit\EditGroup and map your application collection through getGroupCollection().
This keeps the standard editor reusable while allowing the application to supply its own data model
and
validation settings.
| Extension point | Purpose |
|---|---|
getGroupCollection() |
Provide the concrete application collection. |
getFormData() |
Customize fields, labels, values and validation feedback. |
editGetFormData() |
Read additional submitted values. |
editValidateFormData() |
Apply additional application-specific validation. |
editGroupDocument() |
Apply additional changes to the document during the edit workflow. |
Real-world integration: appnetos-api-dev
The appnetos-api-dev admin extension adds administrator and REST API permission checkboxes, processes submitted permissions, and protects certain permissions for the current administrator.
The extension overrides getFormData(), editGetFormData() and editGroupDocument()
to add and save permission fields.
This example demonstrates how the standard editor can be integrated without rebuilding the complete form or AJAX editing workflow.
Templates, localization and customization
The Core App includes versioned Bootstrap templates for the outer editor, form and success response.
The
template paths can be customized through getBaseTemplate(),
getFormTemplate()
and getSuccessTemplate(). The app also includes translation files for localized labels
and
messages.
For a complete explanation of field configuration and rendering, see the separate Core UI
documentation
for CoreUi\Form\FieldBuilder.