Source for file elseif.php
Documentation is available at elseif.php
* Acts as a php elseif block, allowing you to add one more condition
* if the previous one(s) didn't match. See the {if} plugin for syntax details
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from the use of this software.
* This file is released under the LGPL
* "GNU Lesser General Public License"
* More information can be found here:
* {@link http://www.gnu.org/copyleft/lesser.html}
* @copyright Copyright (c) 2008, Jordi Boggiano
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
public static $types =
array
'if' =>
true, 'elseif' =>
true
public function init(array $rest)
public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
$compiler->removeTopBlock();
// fetch the top of the stack
$parent =
& $compiler->getCurrentBlock();
// loop until we get an elseif or if block
while (!isset
(self::$types[$parent['type']])) {
$out .=
$compiler->removeTopBlock();
$parent =
& $compiler->getCurrentBlock();
$out .=
$parent['params']['postOutput'];
$parent['params']['postOutput'] =
'';
$compiler->injectBlock($type, $params, 1);
$currentBlock =
& $compiler->getCurrentBlock();
$params =
$compiler->getCompiledParams($params);
return $out .
" elseif (".
implode(' ', self::replaceKeywords($params['*'], $compiler)).
") {\n" .
Dwoo_Compiler::PHP_CLOSE;
public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content)
if (isset
($params['postOutput'])) {
return $content .
$params['postOutput'];
Documentation generated on Sun, 03 Aug 2008 15:12:32 +0200 by phpDocumentor 1.4.0