Commit edd78896 authored by catch's avatar catch

Issue #2376791 by dawehner, Wim Leers: Move all _content routing definitions to _controller

parent df19f0b7
......@@ -54,7 +54,7 @@
* dblog.overview:
* path: '/admin/reports/dblog'
* defaults:
* _content: '\Drupal\dblog\Controller\DbLogController::overview'
* _controller: '\Drupal\dblog\Controller\DbLogController::overview'
* _title: 'Recent log messages'
* requirements:
* _permission: 'access site reports'
......@@ -69,8 +69,6 @@
* and can also give other information, such as the page title and additional
* arguments for the route controller method. There are several possibilities
* for how to build the main content, including:
* - _content: A callable, usually a method on a page controller class
* (see @ref sec_controller below for details).
* - _controller: A callable, usually a method on a page controller class
* (see @ref sec_controller below for details).
* - _form: A form controller class. See the
......
......@@ -61,18 +61,18 @@ public function __construct(ControllerResolverInterface $resolver, EntityManager
* {@inheritdoc}
*/
public function enhance(array $defaults, Request $request) {
if (empty($defaults['_content'])) {
if (empty($defaults['_controller'])) {
if (!empty($defaults['_entity_form'])) {
$wrapper = new HtmlEntityFormController($this->resolver, $this->manager, $this->formBuilder, $defaults['_entity_form']);
$defaults['_content'] = array($wrapper, 'getContentResult');
$defaults['_controller'] = array($wrapper, 'getContentResult');
}
elseif (!empty($defaults['_entity_list'])) {
$defaults['_content'] = '\Drupal\Core\Entity\Controller\EntityListController::listing';
$defaults['_controller'] = '\Drupal\Core\Entity\Controller\EntityListController::listing';
$defaults['entity_type'] = $defaults['_entity_list'];
unset($defaults['_entity_list']);
}
elseif (!empty($defaults['_entity_view'])) {
$defaults['_content'] = '\Drupal\Core\Entity\Controller\EntityViewController::view';
$defaults['_controller'] = '\Drupal\Core\Entity\Controller\EntityViewController::view';
if (strpos($defaults['_entity_view'], '.') !== FALSE) {
// The _entity_view entry is of the form entity_type.view_mode.
list($entity_type, $view_mode) = explode('.', $defaults['_entity_view']);
......
......@@ -49,8 +49,7 @@ public function __construct(EntityManagerInterface $entity_manager, ClassResolve
* Gets the controller class using route defaults.
*
* By design we cannot support all possible routes, but just the ones which
* use the defaults provided by core, which are _content, _controller
* and _form.
* use the defaults provided by core, which are _controller and _form.
*
* Rather than creating an instance of every controller determine the class
* and method that would be used. This is not possible for the service:method
......@@ -67,9 +66,6 @@ public function __construct(EntityManagerInterface $entity_manager, ClassResolve
*/
protected function getControllerClass(array $defaults) {
$controller = NULL;
if (isset($defaults['_content'])) {
$controller = $defaults['_content'];
}
if (isset($defaults['_controller'])) {
$controller = $defaults['_controller'];
}
......
......@@ -30,6 +30,7 @@ protected function alterRoutes(RouteCollection $collection) {
RouteObjectInterface::ROUTE_OBJECT,
RouteObjectInterface::ROUTE_NAME,
'_content',
'_controller',
'_form',
);
foreach ($collection->all() as $name => $route) {
......
......@@ -25,9 +25,10 @@
* - exception handlers
*
* i.e. use this when rendering HTML pages in limited environments. Otherwise,
* use a @code _content @endcode route, this will cause a main content renderer
* (\Drupal\Core\Render\MainContent\MainContentRendererInterface) to be used,
* and in case of a HTML request that will be
* use a @code _controller @endcode route, and return a render array.
* This will cause a main content renderer
* (\Drupal\Core\Render\MainContent\MainContentRendererInterface) to be
* used, and in case of a HTML request that will be
* \Drupal\Core\Render\MainContent\HtmlRenderer.
*
* In fact, this is not only *typically* used in a limited environment, it even
......
......@@ -155,8 +155,9 @@ public function renderResponse(array $main_content, Request $request, RouteMatch
* If the selected display variant does not implement PageVariantInterface.
*/
protected function prepare(array $main_content, Request $request, RouteMatchInterface $route_match) {
// If the _content result already is #type => page, we have no work to do:
// the "main content" already is an entire "page" (see html.html.twig).
// If the _controller result already is #type => page,
// we have no work to do: The "main content" already is an entire "page"
// (see html.html.twig).
if (isset($main_content['#type']) && $main_content['#type'] === 'page') {
$page = $main_content;
}
......
......@@ -11,10 +11,10 @@
use Symfony\Component\HttpFoundation\Request;
/**
* The interface for "main content" (@code _content @endcode) renderers.
* The interface for "main content" (@code _controller @endcode) renderers.
*
* Classes implementing this interface are able to render the main content (as
* received from "_content" controllers) into a response of a certain format
* received from controllers) into a response of a certain format
* (HTML, JSON …) and/or in a certain decorated manner (e.g. in the case of the
* default HTML main content renderer: with a page display variant applied).
*/
......
aggregator.admin_overview:
path: '/admin/config/services/aggregator'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::adminOverview'
_controller: '\Drupal\aggregator\Controller\AggregatorController::adminOverview'
_title: 'Feed aggregator'
requirements:
_permission: 'administer news feeds'
......@@ -25,7 +25,7 @@ aggregator.feed_items_delete:
aggregator.feed_refresh:
path: '/admin/config/services/aggregator/update/{aggregator_feed}'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::feedRefresh'
_controller: '\Drupal\aggregator\Controller\AggregatorController::feedRefresh'
_title: 'Update items'
requirements:
_permission: 'administer news feeds'
......@@ -42,7 +42,7 @@ aggregator.opml_add:
aggregator.feed_add:
path: '/aggregator/sources/add'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::feedAdd'
_controller: '\Drupal\aggregator\Controller\AggregatorController::feedAdd'
_title: 'Add feed'
requirements:
_permission: 'administer news feeds'
......@@ -80,7 +80,7 @@ entity.aggregator_feed.delete_form:
aggregator.page_last:
path: '/aggregator'
defaults:
_content: '\Drupal\aggregator\Controller\AggregatorController::pageLast'
_controller: '\Drupal\aggregator\Controller\AggregatorController::pageLast'
_title: 'Feed aggregator'
requirements:
_permission: 'access news feeds'
block.admin_demo:
path: '/admin/structure/block/demo/{theme}'
defaults:
_content: '\Drupal\block\Controller\BlockController::demo'
_controller: '\Drupal\block\Controller\BlockController::demo'
_title_callback: 'theme_handler:getName'
requirements:
_access_theme: 'TRUE'
......@@ -28,7 +28,7 @@ entity.block.edit_form:
block.admin_display:
path: '/admin/structure/block'
defaults:
_content: '\Drupal\block\Controller\BlockListController::listing'
_controller: '\Drupal\block\Controller\BlockListController::listing'
_title: 'Block layout'
requirements:
_permission: 'administer blocks'
......@@ -36,7 +36,7 @@ block.admin_display:
block.admin_display_theme:
path: 'admin/structure/block/list/{theme}'
defaults:
_content: '\Drupal\block\Controller\BlockListController::listing'
_controller: '\Drupal\block\Controller\BlockListController::listing'
_title: 'Block layout'
requirements:
_access_theme: 'TRUE'
......@@ -45,7 +45,7 @@ block.admin_display_theme:
block.admin_add:
path: '/admin/structure/block/add/{plugin_id}/{theme}'
defaults:
_content: '\Drupal\block\Controller\BlockAddController::blockAddConfigureForm'
_controller: '\Drupal\block\Controller\BlockAddController::blockAddConfigureForm'
theme: null
_title: 'Configure block'
requirements:
......
......@@ -9,7 +9,7 @@ block_content.type_list:
block_content.add_page:
path: '/block/add'
defaults:
_content: '\Drupal\block_content\Controller\BlockContentController::add'
_controller: '\Drupal\block_content\Controller\BlockContentController::add'
_title: 'Add custom block'
options:
_admin_route: TRUE
......@@ -19,7 +19,7 @@ block_content.add_page:
block_content.add_form:
path: '/block/add/{block_content_type}'
defaults:
_content: '\Drupal\block_content\Controller\BlockContentController::addForm'
_controller: '\Drupal\block_content\Controller\BlockContentController::addForm'
_title_callback: 'Drupal\block_content\Controller\BlockContentController::getAddFormTitle'
options:
_admin_route: TRUE
......
book.render:
path: '/book'
defaults:
_content: '\Drupal\book\Controller\BookController::bookRender'
_controller: '\Drupal\book\Controller\BookController::bookRender'
_title: 'Books'
requirements:
_permission: 'access content'
......@@ -9,7 +9,7 @@ book.render:
book.admin:
path: '/admin/structure/book'
defaults:
_content: '\Drupal\book\Controller\BookController::adminOverview'
_controller: '\Drupal\book\Controller\BookController::adminOverview'
_title: 'Books'
requirements:
_permission: 'administer book outlines'
......
......@@ -2,7 +2,7 @@ comment.admin:
path: '/admin/content/comment'
defaults:
_title: 'Comments'
_content: '\Drupal\comment\Controller\AdminController::adminPage'
_controller: '\Drupal\comment\Controller\AdminController::adminPage'
type: 'new'
requirements:
_permission: 'administer comments'
......@@ -11,7 +11,7 @@ comment.admin_approval:
path: '/admin/content/comment/approval'
defaults:
_title: 'Unapproved comments'
_content: '\Drupal\comment\Controller\AdminController::adminPage'
_controller: '\Drupal\comment\Controller\AdminController::adminPage'
type: 'approval'
requirements:
_permission: 'administer comments'
......@@ -28,7 +28,7 @@ comment.approve:
path: '/comment/{comment}/approve'
defaults:
_title: 'Approve'
_content: '\Drupal\comment\Controller\CommentController::commentApprove'
_controller: '\Drupal\comment\Controller\CommentController::commentApprove'
entity_type: 'comment'
requirements:
_entity_access: 'comment.approve'
......@@ -53,7 +53,7 @@ entity.comment.delete_form:
comment.reply:
path: '/comment/reply/{entity_type}/{entity}/{field_name}/{pid}'
defaults:
_content: '\Drupal\comment\Controller\CommentController::getReplyForm'
_controller: '\Drupal\comment\Controller\CommentController::getReplyForm'
_title: 'Add new comment'
pid: ~
requirements:
......
......@@ -2,7 +2,7 @@ comment_test.report:
path: '/comment/{comment}/report'
defaults:
_title: 'Report'
_content: '\Drupal\comment_test\Controller\CommentTestController::commentReport'
_controller: '\Drupal\comment_test\Controller\CommentTestController::commentReport'
requirements:
_access: 'TRUE'
_csrf_token: 'TRUE'
......@@ -9,7 +9,7 @@ config.sync:
config.diff:
path: '/admin/config/development/configuration/sync/diff/{source_name}/{target_name}'
defaults:
_content: '\Drupal\config\Controller\ConfigController::diff'
_controller: '\Drupal\config\Controller\ConfigController::diff'
target_name: NULL
requirements:
_permission: 'synchronize configuration'
......@@ -17,7 +17,7 @@ config.diff:
config.diff_collection:
path: '/admin/config/development/configuration/sync/diff_collection/{collection}/{source_name}/{target_name}'
defaults:
_content: '\Drupal\config\Controller\ConfigController::diff'
_controller: '\Drupal\config\Controller\ConfigController::diff'
target_name: NULL
requirements:
_permission: 'synchronize configuration'
......
......@@ -32,7 +32,7 @@ entity.config_test.edit_form_config_test_no_status:
entity.config_test.enable:
path: '/admin/structure/config_test/manage/{config_test}/enable'
defaults:
_content: '\Drupal\config_test\ConfigTestController::enable'
_controller: '\Drupal\config_test\ConfigTestController::enable'
entity_type: 'config_test'
requirements:
_access: 'TRUE'
......@@ -40,7 +40,7 @@ entity.config_test.enable:
entity.config_test.disable:
path: '/admin/structure/config_test/manage/{config_test}/disable'
defaults:
_content: '\Drupal\config_test\ConfigTestController::disable'
_controller: '\Drupal\config_test\ConfigTestController::disable'
entity_type: 'config_test'
requirements:
_access: 'TRUE'
......@@ -62,6 +62,6 @@ entity.config_test.delete_form_config_test_no_status:
config_test.schema_listener:
path: '/config_test/schema_listener'
defaults:
_content: '\Drupal\config_test\SchemaListenerController::test'
_controller: '\Drupal\config_test\SchemaListenerController::test'
requirements:
_access: 'TRUE'
......@@ -2,13 +2,13 @@ config_translation.mapper_list:
path: '/admin/config/regional/config-translation'
defaults:
_title: 'Configuration translation'
_content: '\Drupal\config_translation\Controller\ConfigTranslationMapperList::render'
_controller: '\Drupal\config_translation\Controller\ConfigTranslationMapperList::render'
requirements:
_permission: 'translate configuration'
config_translation.entity_list:
path: '/admin/config/regional/config-translation/{mapper_id}'
defaults:
_content: '\Drupal\config_translation\Controller\ConfigTranslationListController::listing'
_controller: '\Drupal\config_translation\Controller\ConfigTranslationListController::listing'
requirements:
_permission: 'translate configuration'
......@@ -225,7 +225,7 @@ public function getOverviewRoute() {
$route = new Route(
$this->getBaseRoute()->getPath() . '/translate',
array(
'_content' => '\Drupal\config_translation\Controller\ConfigTranslationController::itemPage',
'_controller' => '\Drupal\config_translation\Controller\ConfigTranslationController::itemPage',
'plugin_id' => $this->getPluginId(),
),
array('_config_translation_overview_access' => 'TRUE')
......
......@@ -192,7 +192,7 @@ public function testGetOverviewRouteParameters() {
public function testGetOverviewRoute() {
$expected = new Route('/admin/config/system/site-information/translate',
array(
'_content' => '\Drupal\config_translation\Controller\ConfigTranslationController::itemPage',
'_controller' => '\Drupal\config_translation\Controller\ConfigTranslationController::itemPage',
'plugin_id' => 'system.site_information_settings',
),
array(
......
......@@ -34,7 +34,7 @@ contact.site_page:
path: '/contact'
defaults:
_title: 'Contact'
_content: '\Drupal\contact\Controller\ContactController::contactSitePage'
_controller: '\Drupal\contact\Controller\ContactController::contactSitePage'
contact_form: NULL
requirements:
_permission: 'access site-wide contact form'
......@@ -43,7 +43,7 @@ contact.site_page_form:
path: '/contact/{contact_form}'
defaults:
_title: 'Contact'
_content: '\Drupal\contact\Controller\ContactController::contactSitePage'
_controller: '\Drupal\contact\Controller\ContactController::contactSitePage'
requirements:
_entity_access: 'contact_form.view'
......@@ -51,6 +51,6 @@ entity.user.contact_form:
path: '/user/{user}/contact'
defaults:
_title: 'Contact'
_content: '\Drupal\contact\Controller\ContactController::contactPersonalPage'
_controller: '\Drupal\contact\Controller\ContactController::contactPersonalPage'
requirements:
_access_contact_personal_tab: 'TRUE'
......@@ -56,7 +56,7 @@ protected function alterRoutes(RouteCollection $collection) {
$route = new Route(
$path,
array(
'_content' => '\Drupal\content_translation\Controller\ContentTranslationController::overview',
'_controller' => '\Drupal\content_translation\Controller\ContentTranslationController::overview',
'entity_type_id' => $entity_type_id,
),
array(
......@@ -76,7 +76,7 @@ protected function alterRoutes(RouteCollection $collection) {
$route = new Route(
$path . '/add/{source}/{target}',
array(
'_content' => '\Drupal\content_translation\Controller\ContentTranslationController::add',
'_controller' => '\Drupal\content_translation\Controller\ContentTranslationController::add',
'source' => NULL,
'target' => NULL,
'_title' => 'Add',
......@@ -108,7 +108,7 @@ protected function alterRoutes(RouteCollection $collection) {
$route = new Route(
$path . '/edit/{language}',
array(
'_content' => '\Drupal\content_translation\Controller\ContentTranslationController::edit',
'_controller' => '\Drupal\content_translation\Controller\ContentTranslationController::edit',
'language' => NULL,
'_title' => 'Edit',
'entity_type_id' => $entity_type_id,
......
dblog.overview:
path: '/admin/reports/dblog'
defaults:
_content: '\Drupal\dblog\Controller\DbLogController::overview'
_controller: '\Drupal\dblog\Controller\DbLogController::overview'
_title: 'Recent log messages'
requirements:
_permission: 'access site reports'
......@@ -17,7 +17,7 @@ dblog.confirm:
dblog.event:
path: '/admin/reports/dblog/event/{event_id}'
defaults:
_content: '\Drupal\dblog\Controller\DbLogController::eventDetails'
_controller: '\Drupal\dblog\Controller\DbLogController::eventDetails'
_title: 'Details'
requirements:
_permission: 'access site reports'
......@@ -26,7 +26,7 @@ dblog.page_not_found:
path: '/admin/reports/page-not-found'
defaults:
_title: "Top 'page not found' errors"
_content: '\Drupal\dblog\Controller\DbLogController::topLogMessages'
_controller: '\Drupal\dblog\Controller\DbLogController::topLogMessages'
type: 'page not found'
requirements:
_permission: 'access site reports'
......@@ -35,7 +35,7 @@ dblog.access_denied:
path: '/admin/reports/access-denied'
defaults:
_title: "Top 'access denied' errors"
_content: '\Drupal\dblog\Controller\DbLogController::topLogMessages'
_controller: '\Drupal\dblog\Controller\DbLogController::topLogMessages'
type: 'access denied'
requirements:
_permission: 'access site reports'
......@@ -43,7 +43,7 @@ dblog.access_denied:
dblog.search:
path: '/admin/reports/search'
defaults:
_content: '\Drupal\dblog\Controller\DbLogController::topLogMessages'
_controller: '\Drupal\dblog\Controller\DbLogController::topLogMessages'
_title: 'Top search phrases'
type: 'search'
requirements:
......
......@@ -9,7 +9,7 @@ field_ui.list:
field_ui.display_mode:
path: '/admin/structure/display-modes'
defaults:
_content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
_title: 'Display modes'
requirements:
_permission: 'administer display modes'
......@@ -25,7 +25,7 @@ field_ui.entity_view_mode_list:
field_ui.entity_view_mode_add:
path: '/admin/structure/display-modes/view/add'
defaults:
_content: '\Drupal\field_ui\Controller\EntityDisplayModeController::viewModeTypeSelection'
_controller: '\Drupal\field_ui\Controller\EntityDisplayModeController::viewModeTypeSelection'
_title: 'Choose view mode entity type'
requirements:
_permission: 'administer display modes'
......@@ -65,7 +65,7 @@ field_ui.entity_form_mode_list:
field_ui.entity_form_mode_add:
path: '/admin/structure/display-modes/form/add'
defaults:
_content: '\Drupal\field_ui\Controller\EntityDisplayModeController::formModeTypeSelection'
_controller: '\Drupal\field_ui\Controller\EntityDisplayModeController::formModeTypeSelection'
_title: 'Choose form mode entity type'
requirements:
_permission: 'administer display modes'
......
filter.tips_all:
path: '/filter/tips'
defaults:
_content: '\Drupal\filter\Controller\FilterController::filterTips'
_controller: '\Drupal\filter\Controller\FilterController::filterTips'
_title: 'Compose tips'
requirements:
_access: 'TRUE'
......@@ -9,7 +9,7 @@ filter.tips_all:
filter.tips:
path: '/filter/tips/{filter_format}'
defaults:
_content: '\Drupal\filter\Controller\FilterController::filterTips'
_controller: '\Drupal\filter\Controller\FilterController::filterTips'
_title: 'Compose tips'
requirements:
_entity_access: 'filter_format.use'
......@@ -17,7 +17,7 @@ filter.tips:
filter.admin_overview:
path: '/admin/config/content/formats'
defaults:
_content: '\Drupal\Core\Entity\Controller\EntityListController::listing'
_controller: '\Drupal\Core\Entity\Controller\EntityListController::listing'
entity_type: 'filter_format'
_title: 'Text formats and editors'
requirements:
......
......@@ -17,7 +17,7 @@ forum.settings:
forum.index:
path: '/forum'
defaults:
_content: '\Drupal\forum\Controller\ForumController::forumIndex'
_controller: '\Drupal\forum\Controller\ForumController::forumIndex'
_title: 'Forums'
requirements:
_permission: 'access content'
......@@ -25,7 +25,7 @@ forum.index:
forum.page:
path: '/forum/{taxonomy_term}'
defaults:
_content: '\Drupal\forum\Controller\ForumController::forumPage'
_controller: '\Drupal\forum\Controller\ForumController::forumPage'
_title_callback: '\Drupal\taxonomy\Controller\TaxonomyController::termTitle'
requirements:
_permission: 'access content'
......@@ -33,7 +33,7 @@ forum.page:
forum.add_container:
path: '/admin/structure/forum/add/container'
defaults:
_content: '\Drupal\forum\Controller\ForumController::addContainer'
_controller: '\Drupal\forum\Controller\ForumController::addContainer'
_title: 'Add container'
requirements:
_permission: 'administer forums'
......@@ -41,7 +41,7 @@ forum.add_container:
forum.add_forum:
path: '/admin/structure/forum/add/forum'
defaults:
_content: '\Drupal\forum\Controller\ForumController::addForum'
_controller: '\Drupal\forum\Controller\ForumController::addForum'
_title: 'Add forum'
requirements:
_permission: 'administer forums'
......
help.main:
path: '/admin/help'
defaults:
_content: '\Drupal\help\Controller\HelpController::helpMain'
_controller: '\Drupal\help\Controller\HelpController::helpMain'
_title: 'Help'
requirements:
_permission: 'access administration pages'
......@@ -9,7 +9,7 @@ help.main:
help.page:
path: '/admin/help/{name}'
defaults:
_content: '\Drupal\help\Controller\HelpController::helpPage'
_controller: '\Drupal\help\Controller\HelpController::helpPage'
_title: 'Help'
requirements:
_permission: 'access administration pages'
language_test.l_active_class:
path: '/language_test/type-link-active-class'
defaults:
_content: '\Drupal\language_test\Controller\LanguageTestController::typeLinkActiveClass'
_controller: '\Drupal\language_test\Controller\LanguageTestController::typeLinkActiveClass'
requirements:
_access: 'TRUE'
......
......@@ -16,7 +16,7 @@ locale.check_translation:
locale.translate_page:
path: '/admin/config/regional/translate'
defaults:
_content: '\Drupal\locale\Controller\LocaleController::translatePage'
_controller: '\Drupal\locale\Controller\LocaleController::translatePage'
_title: 'User interface translation'
requirements:
_permission: 'translate interface'
......
entity.menu.add_link_form:
path: '/admin/structure/menu/manage/{menu}/add'
defaults:
_content: '\Drupal\menu_link_content\Controller\MenuController::addLink'
_controller: '\Drupal\menu_link_content\Controller\MenuController::addLink'
_title: 'Add menu link'
requirements:
_entity_create_access: 'menu_link_content'
......
......@@ -18,7 +18,7 @@ node.add_page:
path: '/node/add'
defaults:
_title: 'Add content'
_content: '\Drupal\node\Controller\NodeController::addPage'
_controller: '\Drupal\node\Controller\NodeController::addPage'
options:
_access_mode: 'ANY'
_node_operation_route: TRUE
......@@ -29,7 +29,7 @@ node.add_page:
node.add:
path: '/node/add/{node_type}'
defaults:
_content: '\Drupal\node\Controller\NodeController::add'
_controller: '\Drupal\node\Controller\NodeController::add'
_title_callback: '\Drupal\node\Controller\NodeController::addPageTitle'
requirements:
_node_add_access: 'node:{node_type}'
......@@ -39,7 +39,7 @@ node.add:
entity.node.preview:
path: '/node/preview/{node_preview}/{view_mode_id}'
defaults:
_content: '\Drupal\node\Controller\NodePreviewController::view'
_controller: '\Drupal\node\Controller\NodePreviewController::view'
_title_callback: '\Drupal\node\Controller\NodePreviewController::title'
requirements:
_node_preview_access: '{node_preview}'
......@@ -51,7 +51,7 @@ entity.node.preview:
entity.node.canonical:
path: '/node/{node}'
defaults:
_content: '\Drupal\node\Controller\NodeViewController::view'
_controller: '\Drupal\node\Controller\NodeViewController::view'
_title_callback: '\Drupal\node\Controller\NodeViewController::title'
requirements:
_entity_access: 'node.view'
......@@ -70,7 +70,7 @@ entity.node.version_history:
path: '/node/{node}/revisions'
defaults:
_title: 'Revisions'
_content: '\Drupal\node\Controller\NodeController::revisionOverview'
_controller: '\Drupal\node\Controller\NodeController::revisionOverview'
requirements:
_access_node_revision: 'view'
options:
......@@ -79,7 +79,7 @@ entity.node.version_history:
node.revision_show:
path: '/node/{node}/revisions/{node_revision}/view'
defaults:
_content: '\Drupal\node\Controller\NodeController::revisionShow'
_controller: '\Drupal\node\Controller\NodeController::revisionShow'
_title_callback: '\Drupal\node\Controller\NodeController::revisionPageTitle'
requirements:
_access_node_revision: 'view'
......@@ -107,7 +107,7 @@ node.revision_delete_confirm:
node.overview_types:
path: '/admin/structure/types'
defaults:
_content: '\Drupal\Core\Entity\Controller\EntityListController::listing'
_controller: '\Drupal\Core\Entity\Controller\EntityListController::listing'
entity_type: 'node_type'
_title: 'Content types'
requirements:
......
......@@ -10,7 +10,7 @@ path.admin_overview:
path: '/admin/config/search/path'
defaults:
_title: 'URL aliases'
_content: '\Drupal\path\Controller\PathController::adminOverview'
_controller: '\Drupal\path\Controller\PathController::adminOverview'
keys: NULL
requirements:
_permission: 'administer url aliases'
......@@ -19,7 +19,7 @@ path.admin_overview_filter:
path: '/admin/config/search/path/filter'
defaults:
_title: 'URL aliases'
_content: '\Drupal\path\Controller\PathController::adminOverview'
_controller: '\Drupal\path\Controller\PathController::adminOverview'
requirements:
_permission: 'administer url aliases'
......
......@@ -57,7 +57,7 @@ public function routes() {
$routes['search.view'] = new Route(
'/search',
array(
'_content' => 'Drupal\search\Controller\SearchController::redirectSearchPage',
'_controller' => 'Drupal\search\Controller\SearchController::redirectSearchPage',
'_title' => 'Search',
'entity' => $default_page,
),
......@@ -79,7 +79,7 @@ public function routes() {
$routes["search.view_$entity_id"] = new Route(
'/search/' . $entity->getPath(),
array(
'_content' => 'Drupal\search\Controller\SearchController::view',
'_controller' => 'Drupal\search\Controller\SearchController::view',
'_title' => 'Search',
'entity' => $entity_id,
),
......
......@@ -49,7 +49,7 @@ entity.shortcut_set.customize_form:
shortcut.link_add:
path: '/admin/config/user-interface/shortcut/manage/{shortcut_set}/add-link'
defaults:
_content: '\Drupal\shortcut\Controller\ShortcutController::addForm'
_controller: '\Drupal\shortcut\Controller\ShortcutController::addForm'
_title: 'Add link'
requirements:
_entity_create_access: 'shortcut:{shortcut_set}'
......
......@@ -376,7 +376,7 @@
* the entity system will load the corresponding entity item and pass it in as
* an object to the controller for the route.
* - defaults: For entity form routes, use _entity_form rather than the generic
* _content or _form. The value is composed of the entity type machine name
* _controller or _form. The value is composed of the entity type machine name
* and a form controller type from the entity annotation (see @ref define
* above more more on controllers and annotation). So, in this example,
* block.default refers to the 'default' form controller on the block entity
......
system.ajax:
path: '/system/ajax'
defaults:
_content: '\Drupal\system\Controller\FormAjaxController::content'
_controller: '\Drupal\system\Controller\FormAjaxController::content'
options:
_theme: ajax_base_page
requirements:
......@@ -10,7 +10,7 @@ system.ajax:
system.403:
path: '/system/403'
defaults:
_content: '\Drupal\system\Controller\Http4xxController:on403'
_controller: '\Drupal\system\Controller\Http4xxController:on403'