Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 313832

Provide a _entity_list route default to replace Controller\EntityListController and mimic _entity_form

$
0
0

In addition to _content, _controller, and _form, the entity system provides _entity_form as an easy way to call EntityFormControllers from routes.

Recently in #1983844: Change notice: Add EntityListController and convert picture.module callbacks to routes/controllers to provide a use-case (which hasn't even had a change notice yet!) we added \Drupal\Core\Entity\Controller\EntityListController to handle this for entity lists, but that was partly confusing since it called through to something usually extending \Drupal\Core\Entity\EntityListController, and it was more verbose than _entity_form.

Here's what it looks like in HEAD now:

user_role_list:
  pattern: '/admin/people/roles'
  defaults:
    _content: '\Drupal\Core\Entity\Controller\EntityListController::listing'
    entity_type: 'user_role'
  requirements:
    _permission: 'administer permissions'

And here it is with this proposal

user_role_list:
  pattern: '/admin/people/roles'
  defaults:
    _entity_list: 'user_role'
  requirements:
    _permission: 'administer permissions'

Eventually, once our page callbacks are converted, we'll likely want one for _entity_render as well (think node/%node, user/%user).


Viewing all articles
Browse latest Browse all 313832

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>