5
5
entity.content_entity_example_contact.canonical :
6
6
path : ' /content_entity_example_contact/{content_entity_example_contact}'
7
7
defaults :
8
- # Calls the view controller, defined in the annotation of the contact entity
8
+ # Calls the view controller, defined in the annotation of the contact
9
+ # entity. This marks this route as belonging to this entity type.
9
10
_entity_view : ' content_entity_example_contact'
10
11
_title : ' Contact content'
11
12
requirements :
12
- # Calls the access controller of the entity, $operation 'view'
13
+ # Calls the access controller of the entity, passing in the suffix ('view')
14
+ # as the $operation parameter to checkAccess().
13
15
_entity_access : ' content_entity_example_contact.view'
14
16
15
17
entity.content_entity_example_contact.collection :
@@ -25,20 +27,25 @@ entity.content_entity_example_contact.collection:
25
27
content_entity_example.contact_add :
26
28
path : ' /content_entity_example_contact/add'
27
29
defaults :
28
- # Calls the form.add controller, defined in the contact entity.
29
- _entity_form : content_entity_example_contact.add
30
+ # Calls the form.add controller, defined in the contact entity.
31
+ _entity_form : content_entity_example_contact.default
30
32
_title : ' Add contact'
31
33
requirements :
34
+ # Use the entity's access controller. _entity_create_access tells the router
35
+ # to use the access controller's checkCreateAccess() method instead of
36
+ # checkAccess().
32
37
_entity_create_access : ' content_entity_example_contact'
33
38
34
39
entity.content_entity_example_contact.edit_form :
35
40
path : ' /content_entity_example_contact/{content_entity_example_contact}/edit'
36
41
defaults :
37
42
# Calls the form.edit controller, defined in the contact entity.
38
- _entity_form : content_entity_example_contact.edit
43
+ _entity_form : content_entity_example_contact.default
39
44
_title : ' Edit contact'
40
45
requirements :
41
- _entity_access : ' content_entity_example_contact.edit'
46
+ # Calls the access controller of the entity, passing in the suffix
47
+ # ('update') as the $operation parameter to checkAccess().
48
+ _entity_access : ' content_entity_example_contact.update'
42
49
43
50
entity.content_entity_example_contact.delete_form :
44
51
path : ' /contact/{content_entity_example_contact}/delete'
@@ -47,6 +54,8 @@ entity.content_entity_example_contact.delete_form:
47
54
_entity_form : content_entity_example_contact.delete
48
55
_title : ' Delete contact'
49
56
requirements :
57
+ # Calls the access controller of the entity, passing in the suffix
58
+ # ('delete') as the $operation parameter to checkAccess().
50
59
_entity_access : ' content_entity_example_contact.delete'
51
60
52
61
content_entity_example.contact_settings :
0 commit comments