Class Dwoo_Plugin_foreach

Description

Implements interfaces:

Similar to the php foreach block, loops over an array

Note that if you don't provide the item parameter, the key will act as item

  * from : the array that you want to iterate over
  * key : variable name for the key (or for the item if item is not defined)
  * item : variable name for each item
  * name : foreach name to access it's iterator variables through {$.foreach.name.var} see http://wiki.dwoo.org/index.php/IteratorVariables for details
Example :

  1.  {foreach $array val}
  2.    {$val.something}
  3.  {/foreach}

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/foreach.php (line 32)

Dwoo_Plugin
   |
   --Dwoo_Block_Plugin
      |
      --Dwoo_Plugin_foreach
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, [ $key = null], [ $item = null], [ $name = 'default'], [ $implode = null])
Variables
static mixed $cnt (line 34)
  • access: public

Inherited Variables

Inherited from Dwoo_Block_Plugin

Dwoo_Block_Plugin::$buffer

Inherited from Dwoo_Plugin

Dwoo_Plugin::$dwoo
Methods
static postProcessing (line 49)
  • 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 40)
  • 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 36)
  • access: public
void init ( $from, [ $key = null], [ $item = null], [ $name = 'default'], [ $implode = null])
  • $from
  • $key
  • $item
  • $name
  • $implode

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 Sat, 18 Jul 2009 21:05:04 +0200 by phpDocumentor 1.4.0