Changeset 1153
- Timestamp:
- 11/08/08 09:46:31 (2 months ago)
- Files:
-
- trunk/lib/jelix/tpl/jTplCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/tpl/tests/compiler.php (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/tests/jtpl.compiler.html_cli.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/tpl/jTplCompiler.class.php
r1145 r1153 154 154 155 155 $_dirname = jTplConfig::$cachePath.dirname($tplName).'/'; 156 echo $tplFile.'<br>'.$_dirname.'<br>'.$cachefile; 156 157 157 if (!is_dir($_dirname)) { 158 158 umask(0000); … … 231 231 232 232 // check the first character 233 if (!preg_match('/^\$|@| [a-zA-Z\/]$/',$firstcar)) {233 if (!preg_match('/^\$|@|=|[a-zA-Z\/]$/',$firstcar)) { 234 234 #if JTPL_STANDALONE 235 235 throw new Exception(sprintf($this->_locales['errors.tpl.tag.syntax.invalid'], $tag, $this->_sourceFile)); … … 239 239 } 240 240 $this->_currentTag = $tag; 241 if ($firstcar == '$' || $firstcar == '@') { 241 if ($firstcar == '=') { 242 return '<?php echo '.$this->_parseVariable(substr($tag,1)).'; ?>'; 243 } else if ($firstcar == '$' || $firstcar == '@') { 242 244 return '<?php echo '.$this->_parseVariable($tag).'; ?>'; 243 245 } else { trunk/lib/jelix/tpl/tests/compiler.php
r1144 r1153 135 135 '<p>ok <?php echo htmlspecialchars(constant($t->_vars[\'foo\']));?></p>', 136 136 ), 137 24=>array( 138 '<p>ok{=$foo.($truc.$bbb)}</p>', 139 '<p>ok<?php echo $t->_vars[\'foo\'].($t->_vars[\'truc\'].$t->_vars[\'bbb\']); ?></p>', 140 ), 141 25=>array( 142 '<p>ok{=intval($foo.($truc.$bbb))}</p>', 143 '<p>ok<?php echo intval($t->_vars[\'foo\'].($t->_vars[\'truc\'].$t->_vars[\'bbb\'])); ?></p>', 144 ), 145 /*26=>array( 146 '', 147 '', 148 ), 149 27=>array( 150 '', 151 '', 152 ),*/ 137 153 ); 138 154 trunk/testapp/modules/jelix_tests/tests/jtpl.compiler.html_cli.php
r1141 r1153 142 142 '<p>ok {const $foo}</p>', 143 143 '<p>ok <?php echo htmlspecialchars(constant($t->_vars[\'foo\']));?></p>', 144 ), 145 24=>array( 146 '<p>ok{=$foo.($truc.$bbb)}</p>', 147 '<p>ok<?php echo $t->_vars[\'foo\'].($t->_vars[\'truc\'].$t->_vars[\'bbb\']); ?></p>', 148 ), 149 25=>array( 150 '<p>ok{=intval($foo.($truc.$bbb))}</p>', 151 '<p>ok<?php echo intval($t->_vars[\'foo\'].($t->_vars[\'truc\'].$t->_vars[\'bbb\'])); ?></p>', 144 152 ), 145 153 );
