Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b7ab3d43
Commit
b7ab3d43
authored
Jan 18, 2009
by
Angie Byron
Browse files
#297952
by aaron: Fix naming conflict with 'file' preprocess variable.
parent
af81911c
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/theme.inc
View file @
b7ab3d43
...
...
@@ -999,21 +999,22 @@ function theme_get_setting($setting_name, $refresh = FALSE) {
/**
* Render a system default template, which is essentially a PHP template.
*
* @param $file
* The filename of the template to render.
* @param $template_file
* The filename of the template to render. Note that this will overwrite
* anything stored in $variables['template_file'] if using a preprocess hook.
* @param $variables
* A keyed array of variables that will appear in the output.
*
* @return
* The output generated by the template.
*/
function
theme_render_template
(
$file
,
$variables
)
{
extract
(
$variables
,
EXTR_SKIP
);
// Extract the variables to a local namespace
ob_start
();
// Start output buffering
include
DRUPAL_ROOT
.
'/'
.
$file
;
// Include the file
$contents
=
ob_get_contents
();
// Get the contents of the buffer
ob_end_clean
();
// End buffering and discard
return
$contents
;
// Return the contents
function
theme_render_template
(
$
template_
file
,
$variables
)
{
extract
(
$variables
,
EXTR_SKIP
);
// Extract the variables to a local namespace
ob_start
();
// Start output buffering
include
DRUPAL_ROOT
.
'/'
.
$
template_
file
;
// Include the
template
file
$contents
=
ob_get_contents
();
// Get the contents of the buffer
ob_end_clean
();
// End buffering and discard
return
$contents
;
// Return the contents
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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