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