Class Dwoo_Plugin_loop

Description

Implements interfaces:

Loops over an array and moves the scope into each value, allowing for shorter loop constructs

Note that to access the array key within a loop block, you have to use the {$_key} variable, you can not specify it yourself.

  * from : the array that you want to iterate over
  * name : loop name to access it's iterator variables through {$.loop.name.var} see http://wiki.dwoo.org/index.php/IteratorVariables for details
Example :

instead of a foreach block such as :

  1.  {foreach $variable value}
  2.    {$value.foo{$value.bar}
  3.  {/foreach}

you can do :

  1.  {loop $variable}
  2.    {$foo{$bar}
  3.  {/loop}

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.

Located in /plugins/builtin/blocks/loop.php (line 41)

Dwoo_Plugin
   |
   --Dwoo_Block_Plugin
      |
      --Dwoo_Plugin_loop
Variable Summary
static mixed $cnt
Method Summary
static void postProcessing (Dwoo_Compiler $compiler,  $params,  $prepend,  $append,  $content)
static void preProcessing (Dwoo_Compiler $compiler,  $params,  $prepend,  $append,  $type)
void init ( $from, [ $name = 'default'])
Variables
static mixed $cnt (line 43)
  • access: public

Inherited Variables

Inherited from Dwoo_Block_Plugin

Dwoo_Block_Plugin::$buffer

Inherited from Dwoo_Plugin

Dwoo_Plugin::$dwoo
Methods
static postProcessing (line 58)
  • access: public
static void postProcessing (Dwoo_Compiler $compiler,  $params,  $prepend,  $append,  $content)
  • Dwoo_Compiler $compiler
  • array $params
  • $prepend
  • $append
  • $content

Redefinition of:
Dwoo_Block_Plugin::postProcessing()
called at compile time to define what the block should output in the compiled template code, happens when the block is ended
static preProcessing (line 49)
  • access: public
static void preProcessing (Dwoo_Compiler $compiler,  $params,  $prepend,  $append,  $type)

Redefinition of:
Dwoo_Block_Plugin::preProcessing()
called at compile time to define what the block should output in the compiled template code, happens when the block is declared
init (line 45)
  • access: public
void init ( $from, [ $name = 'default'])
  • $from
  • $name

Inherited Methods

Inherited From Dwoo_Block_Plugin

Dwoo_Block_Plugin::buffer()
Dwoo_Block_Plugin::end()
Dwoo_Block_Plugin::postProcessing()
Dwoo_Block_Plugin::preProcessing()
Dwoo_Block_Plugin::process()

Inherited From Dwoo_Plugin

Dwoo_Plugin::__construct()
Dwoo_Plugin::paramsToAttributes()

Documentation generated on Sun, 07 Feb 2010 17:53:52 +0000 by phpDocumentor 1.4.0