content_entity_example.routing.yml
Same filename in other branches
6 string references to YAML keys in content_entity_example.routing.yml
- ContactDeleteForm::getCancelUrl in modules/
content_entity_example/ src/ Form/ ContactDeleteForm.php - If the delete command is canceled, return to the contact list.
- ContactDeleteForm::submitForm in modules/
content_entity_example/ src/ Form/ ContactDeleteForm.php - Delete the entity and log the event. logger() replaces the watchdog.
- ContactForm::save in modules/
content_entity_example/ src/ Form/ ContactForm.php - Form submission handler for the 'save' action.
- ContactListBuilder::render in modules/
content_entity_example/ src/ Entity/ Controller/ ContactListBuilder.php - We override ::render() so that we can add our own content above the table. parent::render() is where EntityListBuilder creates the table using our buildHeader() and buildRow() implementations.
- ContentEntityExampleTest::testCreateAdminPermission in modules/
content_entity_example/ tests/ src/ Functional/ ContentEntityExampleTest.php - Ensure admin and users with the right permissions can create contacts.
File
-
modules/
content_entity_example/ content_entity_example.routing.yml
View source
- # This file brings everything together. Very nifty!
-
- # Route names can be used in several places, for example links, redirects, and
- # local actions.
- entity.content_entity_example_contact.canonical:
- path: '/content_entity_example_contact/{content_entity_example_contact}'
- defaults:
-
- # Calls the view controller, defined in the annotation of the contact
- # entity. This marks this route as belonging to this entity type.
- _entity_view: 'content_entity_example_contact'
- _title: 'Contact content'
- requirements:
-
- # Calls the access controller of the entity, passing in the suffix ('view')
- # as the $operation parameter to checkAccess().
- _entity_access: 'content_entity_example_contact.view'
-
- entity.content_entity_example_contact.collection:
- path: '/content_entity_example_contact/list'
- defaults:
-
- # Calls the list controller, defined in the annotation of the contact entity.
- _entity_list: 'content_entity_example_contact'
- _title: 'Contact list'
- requirements:
-
- # Checks for permission directly.
- _permission: 'view contact entity'
-
- content_entity_example.contact_add:
- path: '/content_entity_example_contact/add'
- defaults:
-
- # Calls the form.add controller, defined in the contact entity.
- _entity_form: content_entity_example_contact.default
- _title: 'Add contact'
- requirements:
-
- # Use the entity's access controller. _entity_create_access tells the router
- # to use the access controller's checkCreateAccess() method instead of
- # checkAccess().
- _entity_create_access: 'content_entity_example_contact'
-
- entity.content_entity_example_contact.edit_form:
- path: '/content_entity_example_contact/{content_entity_example_contact}/edit'
- defaults:
-
- # Calls the form.edit controller, defined in the contact entity.
- _entity_form: content_entity_example_contact.default
- _title: 'Edit contact'
- requirements:
-
- # Calls the access controller of the entity, passing in the suffix
- # ('update') as the $operation parameter to checkAccess().
- _entity_access: 'content_entity_example_contact.update'
-
- entity.content_entity_example_contact.delete_form:
- path: '/contact/{content_entity_example_contact}/delete'
- defaults:
-
- # Calls the form.delete controller, defined in the contact entity.
- _entity_form: content_entity_example_contact.delete
- _title: 'Delete contact'
- requirements:
-
- # Calls the access controller of the entity, passing in the suffix
- # ('delete') as the $operation parameter to checkAccess().
- _entity_access: 'content_entity_example_contact.delete'
-
- content_entity_example.contact_settings:
- path: '/admin/structure/content_entity_example_contact_settings'
- defaults:
- _form: '\Drupal\content_entity_example\Form\ContactSettingsForm'
- _title: 'Contact settings'
- requirements:
- _permission: 'administer contact entity'