function show
Same name and namespace in other branches
- 11.x core/includes/common.inc \show()
- 10 core/includes/common.inc \show()
- 9 core/includes/common.inc \show()
- 8.9.x core/includes/common.inc \show()
- 7.x includes/common.inc \show()
Shows a hidden element for later rendering.
Refer to \Drupal\Core\Render\RendererInterface::render() for additional documentation.
Parameters
array $element: The element to be shown.
Return value
array The element.
Deprecated
in drupal:11.4.0 and is removed from drupal:13.0.0. To show form elements, use ['#access'] = TRUE. For render elements, use ['#printed'] = FALSE.
See also
https://www.drupal.org/node/3261271
\Drupal\Core\Render\RendererInterface::render()
1 call to show()
- ProceduralApiDeprecationTest::testShowDeprecation in core/
tests/ Drupal/ Tests/ Core/ Render/ Element/ ProceduralApiDeprecationTest.php - Tests the deprecation of the global show() function.
12 string references to 'show'
- ComposerInspector::getRootPackageInfo in core/
modules/ package_manager/ src/ ComposerInspector.php - Returns the output of `composer show --self` in a directory.
- DisplayPluginBase::optionsSummary in core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php - Provides the default summary for options in the views UI.
- FakeSiteFixtureTest::testComposerShow in core/
modules/ package_manager/ tests/ src/ Kernel/ FakeSiteFixtureTest.php - Tests that Composer show command can be used on the fixture.
- Node::buildFilters in core/
modules/ node/ src/ Plugin/ views/ wizard/ Node.php - Builds the form structure for selecting the view's filters.
- Node::defaultDisplayFiltersUser in core/
modules/ node/ src/ Plugin/ views/ wizard/ Node.php - Retrieves filter information based on user input for the default display.
File
-
core/
includes/ common.inc, line 323
Code
function show(&$element) {
@trigger_error("The global show() function is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. To show form elements, use ['#access'] = TRUE. For render elements, use ['#printed'] = FALSE. See https://www.drupal.org/node/3261271", E_USER_DEPRECATED);
$element['#printed'] = FALSE;
return $element;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.