.

RendererChain Class Reference
[Controller]

Delegates rendering to a chain of IRenderDecorators. More...

Inheritance diagram for RendererChain:
IRenderer

List of all members.

Public Member Functions

  __construct ($page_data, $arr_decorators)
  Constuctor.
  render ($policy=self::NONE)
  Renders what should be rendered.

Protected Attributes

  $chain_root = null
  $page_data = null

Detailed Description

Delegates rendering to a chain of IRenderDecorators.

Author:
Gerd Riesselmann

Definition at line 8 of file rendererchain.cls.php.


Constructor & Destructor Documentation

RendererChain::__construct ( page_data,
arr_decorators  
)

Constuctor.

Parameters:
PageData  $page_data
array  $arr_decorators Array of IRenderDecorators

Definition at line 29 of file rendererchain.cls.php.

00029                                                                  {
00030                 $this->page_data = $page_data;
00031                 $this->chain_root = new RenderDecoratorBase(); // Ensure there is at least somethin
00032                 foreach($arr_decorators as $decorator) {
00033                         if ($decorator instanceof IRenderDecorator) {
00034                                 $this->chain_root->append($decorator);
00035                         }       
00036                 }
00037         }

Member Function Documentation

RendererChain::render ( policy = self::NONE  ) 

Renders what should be rendered.

Parameters:
int  $policy
Returns:
string The rendered content

Implements IRenderer.

Definition at line 45 of file rendererchain.cls.php.

00045                                                    {
00046                 $this->chain_root->initialize($this->page_data);
00047                 return $this->chain_root->render_page($this->page_data, $this->chain_root, $policy);
00048         }

Member Data Documentation

RendererChain::$chain_root = null [protected]

Definition at line 21 of file rendererchain.cls.php.

RendererChain::$page_data = null [protected]

Definition at line 14 of file rendererchain.cls.php.


The documentation for this class was generated from the following file: