[Example] Integrate custom entity into the administration interface#84
[Example] Integrate custom entity into the administration interface#84niklasnatter wants to merge 1 commit intomasterfrom
Conversation
2138884 to
19b7d58
Compare
9f4a7f0 to
4653f9f
Compare
| { | ||
| if ($this->securityChecker->hasPermission(Event::SECURITY_CONTEXT, PermissionTypes::EDIT)) { | ||
| $rootNavigationItem = new NavigationItem('app.events'); | ||
| $rootNavigationItem->setIcon('su-calendar'); |
There was a problem hiding this comment.
Available icons are documented in the Sulu Javascript Docs.
4653f9f to
cd4fe57
Compare
3a052f7 to
3ccf457
Compare
| <list xmlns="http://schemas.sulu.io/list-builder/list"> | ||
| <key>events</key> | ||
|
|
||
| <properties> |
There was a problem hiding this comment.
List configurations can include fields of associated entities by defining <join> tags. An example can be found in the list configuration of the built-in contact entity.
737467e to
2f49214
Compare
| <entity-name>App\Entity\Event</entity-name> | ||
| </property> | ||
|
|
||
| <property name="startDate" visibility="yes" translation="app.start_date" type="date"> |
There was a problem hiding this comment.
Available values for the type attribute of <property> tags are printed to the development console of the browser when an invalid type such as invalid-property-type is used in a list configuration.
| > | ||
| <key>event_details</key> | ||
|
|
||
| <properties> |
There was a problem hiding this comment.
The form view can be structured by using <section> tags in the form configuration. An example can be found in the form configuration of the built-in contact entity.
| </meta> | ||
| </property> | ||
|
|
||
| <property name="startDate" type="date" colspan="6"> |
There was a problem hiding this comment.
Available values for the type attribute of <property> tags are printed to the development console of the browser when an invalid type such as invalid-property-type is used in a form configuration.
d052269 to
7265b30
Compare
7265b30 to
69b1e17
Compare
69b1e17 to
46a3a42
Compare
46a3a42 to
66a3d03
Compare
66a3d03 to
18cd7be
Compare
What's in this PR?
This PR demonstrates how to integrate an entity into the administration interface of Sulu. The example implements a simple
Evententity that consists of a name, a start-date and an end-date. The entity is persisted using Doctrine and the API for managing the entity is implemented using a Symfony controller.Have a look at the Extend Admin UI documentation for more information about the changes in this PR.
To apply the changes, the schema of the database needs to be updated by executing
bin/console doctrine:schema:update --force. Furthermore, the permissions for the Event entity need to be added to theUseruser role via the administration interface.