- enabled short boolean attributes {some attr} equala {some attr=true}

This commit is contained in:
Uwe.Tews
2009-09-29 21:40:30 +00:00
parent 0fdcb79ec3
commit 8387d1ef6f
2 changed files with 7 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ class Smarty_Internal_Compile_Print_Expression extends Smarty_Internal_CompileBa
{
$this->compiler = $compiler;
$this->required_attributes = array('value');
$this->optional_attributes = array('assign', 'nocache', 'filter');
$this->optional_attributes = array('assign', 'nocache', 'filter', 'nofilter');
// check and get attributes
$_attr = $this->_get_attributes($args);
@@ -36,6 +36,11 @@ class Smarty_Internal_Compile_Print_Expression extends Smarty_Internal_CompileBa
if (!isset($_attr['filter'])) {
$_attr['filter'] = 'null';
}
if (isset($_attr['nofilter'])) {
if ($_attr['nofilter'] == 'true') {
$_attr['filter'] = 'false';
}
}
if (isset($_attr['assign'])) {
// assign output to variable

View File

@@ -2088,7 +2088,7 @@ static public $yy_action = array(
function yy_r30(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); }
#line 2094 "internal.templateparser.php"
#line 205 "internal.templateparser.y"
function yy_r31(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor=>null); }
function yy_r31(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor=>'true'); }
#line 2097 "internal.templateparser.php"
#line 210 "internal.templateparser.y"
function yy_r32(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }