Exemplo n.º 1
0
 public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
 {
     $preContent = '';
     while (true) {
         $preContent .= $compiler->removeTopBlock();
         $block =& $compiler->getCurrentBlock();
         $interfaces = class_implements($block['class'], false);
         if (in_array('Dwoo_IElseable', $interfaces) !== false) {
             break;
         }
     }
     $params['initialized'] = true;
     $compiler->injectBlock($type, $params);
     return $preContent;
 }
Exemplo n.º 2
0
 public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
 {
     $preContent = '';
     while (true) {
         $preContent .= $compiler->removeTopBlock();
         $block =& $compiler->getCurrentBlock();
         if (!$block) {
             throw new Dwoo_Compilation_Exception($compiler, 'An else block was found but it was not preceded by an if or other else-able construct');
         }
         $interfaces = class_implements($block['class'], false);
         if (in_array('Dwoo_IElseable', $interfaces) !== false) {
             break;
         }
     }
     $params['initialized'] = true;
     $compiler->injectBlock($type, $params);
     return $preContent;
 }