Exemplo n.º 1
0
 public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content)
 {
     if (!isset($params['initialized'])) {
         return '';
     }
     $tokens = $compiler->getParamTokens($params);
     $params = $compiler->getCompiledParams($params);
     $pre = Dwoo_Compiler::PHP_OPEN . "elseif (" . implode(' ', self::replaceKeywords($params['*'], $tokens['*'], $compiler)) . ") {\n" . Dwoo_Compiler::PHP_CLOSE;
     $post = Dwoo_Compiler::PHP_OPEN . "\n}" . Dwoo_Compiler::PHP_CLOSE;
     if (isset($params['hasElse'])) {
         $post .= $params['hasElse'];
     }
     $block =& $compiler->getCurrentBlock();
     $block['params']['hasElse'] = $pre . $content . $post;
     return '';
 }
Exemplo n.º 2
0
 public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content)
 {
     $tokens = $compiler->getParamTokens($params);
     $params = $compiler->getCompiledParams($params);
     $pre = Dwoo_Compiler::PHP_OPEN . 'if (' . implode(' ', self::replaceKeywords($params['*'], $tokens['*'], $compiler)) . ") {\n" . Dwoo_Compiler::PHP_CLOSE;
     $post = Dwoo_Compiler::PHP_OPEN . "\n}" . Dwoo_Compiler::PHP_CLOSE;
     if (isset($params['hasElse'])) {
         $post .= $params['hasElse'];
     }
     return $pre . $content . $post;
 }