Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8ce356a3
Commit
8ce356a3
authored
Aug 20, 2015
by
alexpott
Browse files
Issue
#2554013
by dawehner: Save 5 function calls for every rendered template
parent
ee6c2d59
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/includes/theme.inc
View file @
8ce356a3
...
@@ -1157,9 +1157,6 @@ function template_preprocess_maintenance_task_list(&$variables) {
...
@@ -1157,9 +1157,6 @@ function template_preprocess_maintenance_task_list(&$variables) {
* details.
* details.
*/
*/
function
template_preprocess
(
&
$variables
,
$hook
,
$info
)
{
function
template_preprocess
(
&
$variables
,
$hook
,
$info
)
{
// Tell all templates where they are located.
$variables
[
'directory'
]
=
\
Drupal
::
theme
()
->
getActiveTheme
()
->
getPath
();
// Merge in variables that don't depend on hook and don't change during a
// Merge in variables that don't depend on hook and don't change during a
// single page request.
// single page request.
// Use the advanced drupal_static() pattern, since this is called very often.
// Use the advanced drupal_static() pattern, since this is called very often.
...
@@ -1202,6 +1199,9 @@ function _template_preprocess_default_variables() {
...
@@ -1202,6 +1199,9 @@ function _template_preprocess_default_variables() {
// Give modules a chance to alter the default template variables.
// Give modules a chance to alter the default template variables.
\
Drupal
::
moduleHandler
()
->
alter
(
'template_preprocess_default_variables'
,
$variables
);
\
Drupal
::
moduleHandler
()
->
alter
(
'template_preprocess_default_variables'
,
$variables
);
// Tell all templates where they are located.
$variables
[
'directory'
]
=
\
Drupal
::
theme
()
->
getActiveTheme
()
->
getPath
();
return
$variables
;
return
$variables
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment