Mercurial > hg > cmmr2012-drupal-site
comparison core/themes/engines/twig/twig.engine @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
131 * @param string[] ... | 131 * @param string[] ... |
132 * The string keys of $element to prevent printing. | 132 * The string keys of $element to prevent printing. |
133 * | 133 * |
134 * @return array | 134 * @return array |
135 * The filtered renderable array. | 135 * The filtered renderable array. |
136 * | |
137 * @deprecated in Drupal 8.7.x and will be removed before 9.0.0. Use | |
138 * \Drupal\Core\Template\TwigExtension::withoutFilter() instead. | |
136 */ | 139 */ |
137 function twig_without($element) { | 140 function twig_without($element) { |
138 if ($element instanceof ArrayAccess) { | 141 @trigger_error('twig_without() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Template\TwigExtension::withoutFilter(). See https://www.drupal.org/node/3011154.', E_USER_DEPRECATED); |
139 $filtered_element = clone $element; | 142 /** @var \Drupal\Core\Template\TwigExtension $extension */ |
140 } | 143 $extension = \Drupal::service('twig.extension'); |
141 else { | 144 |
142 $filtered_element = $element; | 145 return call_user_func_array([$extension, 'withoutFilter'], func_get_args()); |
143 } | |
144 $args = func_get_args(); | |
145 unset($args[0]); | |
146 foreach ($args as $arg) { | |
147 if (isset($filtered_element[$arg])) { | |
148 unset($filtered_element[$arg]); | |
149 } | |
150 } | |
151 return $filtered_element; | |
152 } | 146 } |