added optional HTML header to output

This commit is contained in:
mohrt
2001-03-23 17:52:50 +00:00
parent 6cf4fe9a33
commit 552e67835e
3 changed files with 29 additions and 4 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- added optional HTML header to output (Monte)
- significantly improved config_load performance. (Andrei)
- added format attribute to math function. (Monte)
- added html_select_time custom function. (Andrei)

View File

@@ -107,6 +107,10 @@ class Smarty
'count_paragraphs' => 'smarty_mod_count_paragraphs'
);
var $version = "3.0.1pl1"; // Smarty version number
var $show_info_header = true; // display info header at top of page output
// internal vars
var $_error_msg = false; // error messages. true/false
var $_tpl_vars = array();
@@ -354,12 +358,20 @@ class Smarty
extract($this->_tpl_vars);
if($this->show_info_header)
$info_header = '<!-- Smarty '.$this->version.' '.strftime("%Y-%m-%d %H:%M:%S").' -->'."\n\n";
else
$info_header = "";
// if we just need to display the results, don't perform output
// buffering - for speed
if ($display && !$this->caching)
if ($display && !$this->caching) {
echo $info_header;
include($_compile_file);
}
else {
ob_start();
echo $info_header;
include($_compile_file);
$results = ob_get_contents();
ob_end_clean();

View File

@@ -107,6 +107,10 @@ class Smarty
'count_paragraphs' => 'smarty_mod_count_paragraphs'
);
var $version = "3.0.1pl1"; // Smarty version number
var $show_info_header = true; // display info header at top of page output
// internal vars
var $_error_msg = false; // error messages. true/false
var $_tpl_vars = array();
@@ -354,12 +358,20 @@ class Smarty
extract($this->_tpl_vars);
if($this->show_info_header)
$info_header = '<!-- Smarty '.$this->version.' '.strftime("%Y-%m-%d %H:%M:%S").' -->'."\n\n";
else
$info_header = "";
// if we just need to display the results, don't perform output
// buffering - for speed
if ($display && !$this->caching)
if ($display && !$this->caching) {
echo $info_header;
include($_compile_file);
}
else {
ob_start();
echo $info_header;
include($_compile_file);
$results = ob_get_contents();
ob_end_clean();