Source for file withelse.php

Documentation is available at withelse.php

  1. <?php
  2.  
  3. /**
  4.  * This plugin serves as a {else} block specifically for the {with} plugin.
  5.  *
  6.  * This software is provided 'as-is', without any express or implied warranty.
  7.  * In no event will the authors be held liable for any damages arising from the use of this software.
  8.  *
  9.  * @author     Jordi Boggiano <j.boggiano@seld.be>
  10.  * @copyright  Copyright (c) 2008, Jordi Boggiano
  11.  * @license    http://dwoo.org/LICENSE   Modified BSD License
  12.  * @link       http://dwoo.org/
  13.  * @version    1.0.0
  14.  * @date       2008-10-23
  15.  * @package    Dwoo
  16.  */
  17. {
  18.     public function init()
  19.     {
  20.     }
  21.  
  22.     public static function preProcessing(Dwoo_Compiler $compilerarray $params$prepend$append$type)
  23.     {
  24.         $with =$compiler->findBlock('with'true);
  25.  
  26.         $params['initialized'true;
  27.         $compiler->injectBlock($type$params);
  28.  
  29.         return '';
  30.     }
  31.  
  32.     public static function postProcessing(Dwoo_Compiler $compilerarray $params$prepend$append$content)
  33.     {
  34.         if (!isset($params['initialized'])) {
  35.             return '';
  36.         }
  37.  
  38.         $block =$compiler->getCurrentBlock();
  39.         $block['params']['hasElse'Dwoo_Compiler::PHP_OPEN."else {\n".Dwoo_Compiler::PHP_CLOSE $content Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE;
  40.         return '';
  41.     }
  42. }

Documentation generated on Sun, 07 Feb 2010 17:54:01 +0000 by phpDocumentor 1.4.0