Class Dwoo_Plugin_with

Description

Implements interfaces:

Moves the scope down into the provided variable, allowing you to use shorter variable names if you repeatedly access values into a single array

The with block won't display anything at all if the provided scope is empty, so in effect it acts as {if $var}*content*{/if}

  * var : the variable name to move into
Example :

instead of the following :

  1.  {if $long.boring.prefix}
  2.    {$long.boring.prefix.val{$long.boring.prefix.secondVal{$long.boring.prefix.thirdVal}
  3.  {/if}

you can use :

  1.  {with $long.boring.prefix}
  2.    {$val{$secondVal{$thirdVal}
  3.  {/with}

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/with.php (line 41)

Dwoo_Plugin
   |
   --Dwoo_Block_Plugin
      |
      --Dwoo_Plugin_with
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 ( $var)
Variables
static mixed $cnt (line 43)
  • access: protected

Inherited Variables

Inherited from Dwoo_Block_Plugin

Dwoo_Block_Plugin::$buffer

Inherited from Dwoo_Plugin

Dwoo_Plugin::$dwoo
Methods
static postProcessing (line 54)
  • 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 ( $var)
  • $var

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:26 +0200 by phpDocumentor 1.4.0