public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type) { $with =& $compiler->findBlock('for', true); $params['initialized'] = true; $compiler->injectBlock($type, $params); return ''; }
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; }
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; }