-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Example] Integrate custom entity into the administration interface #84
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Event
entity 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 theUser
user role via the administration interface.