Source for file elseif.php

Documentation is available at elseif.php

  1. <?php
  2.  
  3. /**
  4.  * Acts as a php elseif block, allowing you to add one more condition
  5.  * if the previous one(s) didn't match. See the {if} plugin for syntax details
  6.  *
  7.  * This software is provided 'as-is', without any express or implied warranty.
  8.  * In no event will the authors be held liable for any damages arising from the use of this software.
  9.  *
  10.  * This file is released under the LGPL
  11.  * "GNU Lesser General Public License"
  12.  * More information can be found here:
  13.  * {@link http://www.gnu.org/copyleft/lesser.html}
  14.  *
  15.  * @author     Jordi Boggiano <j.boggiano@seld.be>
  16.  * @copyright  Copyright (c) 2008, Jordi Boggiano
  17.  * @license    http://www.gnu.org/copyleft/lesser.html  GNU Lesser General Public License
  18.  * @link       http://dwoo.org/
  19.  * @version    0.9.1
  20.  * @date       2008-05-30
  21.  * @package    Dwoo
  22.  */
  23. {
  24.     public function init(array $rest)
  25.     {
  26.     }
  27.  
  28.     public static function preProcessing(Dwoo_Compiler $compilerarray $params$prepend$append$type)
  29.     {
  30.         $if =$compiler->findBlock('if'true);
  31.         $out $if['params']['postOutput'];
  32.         $if['params']['postOutput''';
  33.  
  34.         $compiler->injectBlock($type$params1);
  35.         $currentBlock =$compiler->getCurrentBlock();
  36.         $currentBlock['params']['postOutput'Dwoo_Compiler::PHP_OPEN."\n}".Dwoo_Compiler::PHP_CLOSE;
  37.  
  38.         if ($out === ''{
  39.             $out Dwoo_Compiler::PHP_OPEN."\n}";
  40.         else {
  41.             $out substr($out0-strlen(Dwoo_Compiler::PHP_CLOSE));
  42.         }
  43.  
  44.         $params $compiler->getCompiledParams($params);
  45.  
  46.         return $out " elseif (".implode(' 'self::replaceKeywords($params['*']$compiler)).") {\n" Dwoo_Compiler::PHP_CLOSE;
  47.     }
  48.  
  49.     public static function postProcessing(Dwoo_Compiler $compilerarray $params$prepend$append$content)
  50.     {
  51.         if (isset($params['postOutput'])) {
  52.             return $content $params['postOutput'];
  53.         else {
  54.             return $content;
  55.         }
  56.     }
  57. }

Documentation generated on Sat, 28 Jun 2008 01:38:21 +0200 by phpDocumentor 1.4.0