Migration SVN
This commit is contained in:
22
system/libs/smarty/plugins/compiler.while.php
Executable file
22
system/libs/smarty/plugins/compiler.while.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty plugin
|
||||
* @package Smarty
|
||||
* @subpackage plugins
|
||||
*/
|
||||
|
||||
/**
|
||||
{assign var="test" value=1}
|
||||
{while ($test <= 5)}
|
||||
{assign var="test" value="`$test+1`"}
|
||||
jo
|
||||
{endwhile}
|
||||
*/
|
||||
|
||||
function smarty_compiler_while($tag_arg, &$smarty) {
|
||||
$res = $smarty->_compile_if_tag($tag_arg);
|
||||
preg_match("/<\?php if (.*): \?>/",$res,$token);
|
||||
return "while " . $token[1] . " {";
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user