]> git.mxchange.org Git - friendica.git/blob - vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_continue.php
Add Smarty to Composer
[friendica.git] / vendor / smarty / smarty / libs / sysplugins / smarty_internal_compile_continue.php
1 <?php
2 /**
3  * Smarty Internal Plugin Compile Continue
4  * Compiles the {continue} tag
5  *
6  * @package    Smarty
7  * @subpackage Compiler
8  * @author     Uwe Tews
9  */
10
11 /**
12  * Smarty Internal Plugin Compile Continue Class
13  *
14  * @package    Smarty
15  * @subpackage Compiler
16  */
17 class Smarty_Internal_Compile_Continue extends Smarty_Internal_Compile_Break
18 {
19
20     /**
21      * Compiles code for the {continue} tag
22      *
23      * @param  array                                $args      array with attributes from parser
24      * @param \Smarty_Internal_TemplateCompilerBase $compiler  compiler object
25      * @param  array                                $parameter array with compilation parameter
26      *
27      * @return string compiled code
28      * @throws \SmartyCompilerException
29      */
30     public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
31     {
32         list($levels, $foreachLevels) = $this->checkLevels($args, $compiler, 'continue');
33         $output = "<?php\n";
34         if ($foreachLevels > 1) {
35             /* @var Smarty_Internal_Compile_Foreach $foreachCompiler */
36             $foreachCompiler = $compiler->getTagCompiler('foreach');
37             $output .= $foreachCompiler->compileRestore($foreachLevels - 1);
38         }
39         $output .= "continue {$levels};?>";
40         return $output;
41     }
42 }