Class Dwoo_Block_Plugin

Description

base class for block plugins

you have to implement the <em>init()</em> method, it will receive the parameters that are in the template code and is called when the block starts

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 /Dwoo/Block/Plugin.php (line 20)

Dwoo_Plugin
   |
   --Dwoo_Block_Plugin
Direct descendents
Class Description
Dwoo_Plugin_a Outputs a html &lt;a&gt; tag
Dwoo_Plugin_auto_escape Overrides the compiler auto-escape setting within the block
Dwoo_Plugin_block This is used only when rendering a template that has blocks but is not extending anything, it doesn't do anything by itself and should not be used outside of template inheritance context, see http://wiki.dwoo.org/index.php/TemplateInheritance to read more about it.
Dwoo_Plugin_capture Captures all the output within this block and saves it into {$.capture.default} by default, or {$.capture.name} if you provide another name.
Dwoo_Plugin_dynamic Marks the contents of the block as dynamic. Which means that it will not be cached.
Dwoo_Plugin_else Generic else block, it supports all builtin optional-display blocks which are if/for/foreach/loop/with
Dwoo_Plugin_for Similar to the php for block
Dwoo_Plugin_foreach Similar to the php foreach block, loops over an array
Dwoo_Plugin_foreachelse This plugin serves as a {else} block specifically for the {foreach} plugin.
Dwoo_Plugin_forelse This plugin serves as a {else} block specifically for the {for} plugin.
Dwoo_Plugin_if Conditional block, the syntax is very similar to the php one, allowing () || && and other php operators. Additional operators and their equivalent php syntax are as follow :
Dwoo_Plugin_loop Loops over an array and moves the scope into each value, allowing for shorter loop constructs
Dwoo_Plugin_section Compatibility plugin for smarty templates, do not use otherwise, this is deprecated.
Dwoo_Plugin_smartyinterface Smarty compatibility layer for block plugins, this is used internally and you should not call it
Dwoo_Plugin_strip Strips the spaces at the beginning and end of each line and also the line breaks
Dwoo_Plugin_template Defines a sub-template that can then be called (even recursively) with the defined arguments
Dwoo_Plugin_textformat Formats a string to the given format, you can wrap lines at a certain
Dwoo_Plugin_topLevelBlock Internal plugin used to wrap the template output, do not use in your templates as it will break them
Dwoo_Plugin_with Moves the scope down into the provided variable, allowing you to use shorter variable names if you repeatedly access values into a single array
Dwoo_Plugin_withelse This plugin serves as a {else} block specifically for the {with} plugin.
Variable Summary
string $buffer
Method Summary
static void postProcessing (Dwoo_Compiler $compiler,  $params, string $prepend, string $append, string $content)
static void preProcessing (Dwoo_Compiler $compiler,  $params, string $prepend, string $append, string $type)
void buffer ( $input)
void end ()
string process ()
Variables
string $buffer = '' (line 27)

stores the contents of the block while it runs

  • access: protected

Inherited Variables

Inherited from Dwoo_Plugin

Dwoo_Plugin::$dwoo
Methods
static postProcessing (line 99)

called at compile time to define what the block should output in the compiled template code, happens when the block is ended

basically this will replace the {/block} tag in the template

static void postProcessing (Dwoo_Compiler $compiler,  $params, string $prepend, string $append, string $content)
  • Dwoo_Compiler $compiler: the compiler instance that calls this function
  • array $params: an array containing original and compiled parameters, see preProcessing() for more details
  • string $prepend: that is just meant to allow a child class to call parent::postProcessing($compiler, $params, "foo();") to add a command before the default commands are executed
  • string $append: that is just meant to allow a child class to call parent::postProcessing($compiler, $params, null, "foo();") to add a command after the default commands are executed
  • string $content: the entire content of the block being closed

Redefined in descendants as:
static preProcessing (line 78)

called at compile time to define what the block should output in the compiled template code, happens when the block is declared

basically this will replace the {block arg arg arg} tag in the template

  • access: public
static void preProcessing (Dwoo_Compiler $compiler,  $params, string $prepend, string $append, string $type)
  • Dwoo_Compiler $compiler: the compiler instance that calls this function
  • array $params: an array containing original and compiled parameters
  • string $prepend: that is just meant to allow a child class to call parent::postProcessing($compiler, $params, "foo();") to add a command before the default commands are executed
  • string $append: that is just meant to allow a child class to call parent::postProcessing($compiler, $params, null, "foo();") to add a command after the default commands are executed
  • string $type: the type is the plugin class name used

Redefined in descendants as:
buffer (line 34)

buffers input, override only if necessary

  • var: the content that must be buffered
  • access: public
void buffer ( $input)
  • $input
end (line 47)

called when the block ends, this is most of the time followed right away by a call of <em>process()</em> but not always, so this should be used to do any shutdown operations on the block object, if required.

  • access: public
void end ()
process (line 58)

called when the block output is required by a parent block

this must read $this->buffer and return it processed

  • access: public
string process ()

Redefined in descendants as:

Inherited Methods

Inherited From Dwoo_Plugin

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

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