HTML_QuickForm2
[ class tree: HTML_QuickForm2 ] [ index: HTML_QuickForm2 ] [ all elements ]

Class: HTML_QuickForm2_Renderer

Source Location: /HTML_QuickForm2-0.3.0/QuickForm2/Renderer.php

Class Overview


Abstract base class for QuickForm2 renderers


Author(s):

Version:

  • Release: 0.3.0

Variables

Methods


Child classes:

HTML_QuickForm2_Renderer_Default
Default renderer for QuickForm2
HTML_QuickForm2_Renderer_Proxy
Proxy class for HTML_QuickForm2 renderers and their plugins
HTML_QuickForm2_Renderer_Array
A renderer for HTML_QuickForm2 building an array of form elements

Inherited Variables

Inherited Methods


Class Details

[line 70]
Abstract base class for QuickForm2 renderers

This class serves two main purposes:

  • Defines the API all renderers should implement (render*() methods);
  • Provides static methods for registering renderers and their plugins and factory() method for creating renderer instances.

Note that renderers should always be instantiated through factory(), in the other case it will not be possible to add plugins.



[ Top ]


Class Variables

$options = array(
        'group_hiddens' => true,
        'required_note' => '<em>*</em> denotes required fields.',
        'errors_prefix' => 'Invalid information entered:',
        'errors_suffix' => 'Please correct these fields.',
        'group_errors'  => false
    )

[line 95]

Renderer options

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 193]

HTML_QuickForm2_Renderer __construct( )

Constructor

Renderer instances should not be created directly, use factory()

  • Access: protected

Overridden in child classes as:

HTML_QuickForm2_Renderer_Proxy::__construct()
Constructor, sets proxied renderer and its plugins
HTML_QuickForm2_Renderer_Array::__construct()
Constructor, adds a new 'static_labels' option

[ Top ]

exportMethods   [line 205]

array exportMethods( )

Returns an array of "published" method names that should be callable through proxy

Methods defined in HTML_QuickForm2_Renderer are proxied automatically, only additional methods should be returned.

  • Access: protected

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::exportMethods()
HTML_QuickForm2_Renderer_Array::exportMethods()

[ Top ]

factory   [line 124]

HTML_QuickForm2_Renderer_Proxy factory( string $type)

Creates a new renderer instance of the given type

A renderer is always wrapped by a Proxy, which handles calling its "published" methods and methods of its plugins. Registered plugins are added automagically to the existing renderer instances so that

  1.  $foo HTML_QuickForm2_Renderer::factory('foo');
  2.  // Plugin implementing bar() method
  3.  HTML_QuickForm2_Renderer::registerPlugin('foo''Plugin_Foo_Bar');
  4.  $foo->bar();
will work.

  • Return: A renderer instance of the given type wrapped by a Proxy
  • Throws: HTML_QuickForm2_InvalidArgumentException If type name is unknown
  • Throws: HTML_QuickForm2_NotFoundException If class for the renderer can not be found and/or loaded from file
  • Access: public

Parameters:

string   $type   —  Type name (treated case-insensitively)

[ Top ]

finishContainer   [line 309]

void finishContainer( HTML_QuickForm2_Node $container)

Finishes rendering a generic container, called after processing contained elements
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::finishContainer()
Finishes rendering a generic container, called after processing contained elements
HTML_QuickForm2_Renderer_Proxy::finishContainer()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::finishContainer()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $container   —  Container being rendered

[ Top ]

finishForm   [line 295]

void finishForm( HTML_QuickForm2_Node $form)

Finishes rendering a form, called after processing contained elements
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::finishForm()
Finishes rendering a form, called after processing contained elements
HTML_QuickForm2_Renderer_Proxy::finishForm()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::finishForm()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $form   —  Form being rendered

[ Top ]

finishGroup   [line 323]

void finishGroup( HTML_QuickForm2_Node $group)

Finishes rendering a group, called after processing grouped elements
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::finishGroup()
Finishes rendering a group, called after processing grouped elements
HTML_QuickForm2_Renderer_Proxy::finishGroup()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::finishGroup()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $group   —  Group being rendered

[ Top ]

getOption   [line 257]

mixed getOption( [string $name = null])

Returns the value(s) of the renderer option(s)
  • Return: value of $name parameter, array of all configuration parameters if $name is not given
  • Throws: HTML_QuickForm2_NotFoundException in case of unknown option
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Proxy::getOption()
Proxies for methods defined in HTML_QuickForm2_Renderer

Parameters:

string   $name   —  parameter name

[ Top ]

register   [line 147]

void register( string $type, string $className, [string $includeFile = null])

Registers a new renderer type
  • Throws: HTML_QuickForm2_InvalidArgumentException if type already registered
  • Access: public

Parameters:

string   $type   —  Type name (treated case-insensitively)
string   $className   —  Class name
string   $includeFile   —  File containing the class, leave empty if class already loaded

[ Top ]

registerPlugin   [line 169]

void registerPlugin( string $type, string $className, [string $includeFile = null])

Registers a plugin for a renderer type
  • Throws: HTML_QuickForm2_InvalidArgumentException if plugin is already registered
  • Access: public

Parameters:

string   $type   —  Renderer type name (treated case-insensitively)
string   $className   —  Plugin class name
string   $includeFile   —  File containing the plugin class, leave empty if class already loaded

[ Top ]

renderElement   [line 274]

void renderElement( HTML_QuickForm2_Node $element)

Renders a generic element
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::renderElement()
Renders a generic element
HTML_QuickForm2_Renderer_Proxy::renderElement()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::renderElement()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $element   —  Element being rendered

[ Top ]

renderHidden   [line 281]

void renderHidden( HTML_QuickForm2_Node $element)

Renders a hidden element
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::renderHidden()
Renders a hidden element
HTML_QuickForm2_Renderer_Proxy::renderHidden()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::renderHidden()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $element   —  Hidden element being rendered

[ Top ]

setOption   [line 230]

HTML_QuickForm2_Renderer setOption( string|array $nameOrOptions, [mixed $value = null])

Sets the option(s) affecting renderer behaviour

The following options are available:

  • 'group_hiddens' - whether to group hidden elements together or render them where they were added (boolean)
  • 'group_errors' - whether to group error messages or render them alongside elements they apply to (boolean)
  • 'errors_prefix' - leading message for grouped errors (string)
  • 'errors_suffix' - trailing message for grouped errors (string)
  • 'required_note' - note displayed if the form contains required elements (string)

  • Throws: HTML_QuickForm2_NotFoundException in case of unknown option
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Proxy::setOption()
Proxies for methods defined in HTML_QuickForm2_Renderer

Parameters:

string|array   $nameOrOptions   —  option name or array ('option name' => 'option value')
mixed   $value   —  parameter value if $nameOrConfig is not an array

[ Top ]

startContainer   [line 302]

void startContainer( HTML_QuickForm2_Node $container)

Starts rendering a generic container, called before processing contained elements
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::startContainer()
Starts rendering a generic container, called before processing contained elements
HTML_QuickForm2_Renderer_Proxy::startContainer()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::startContainer()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $container   —  Container being rendered

[ Top ]

startForm   [line 288]

void startForm( HTML_QuickForm2_Node $form)

Starts rendering a form, called before processing contained elements
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::startForm()
Starts rendering a form, called before processing contained elements
HTML_QuickForm2_Renderer_Proxy::startForm()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::startForm()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $form   —  Form being rendered

[ Top ]

startGroup   [line 316]

void startGroup( HTML_QuickForm2_Node $group)

Starts rendering a group, called before processing grouped elements
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Renderer_Default::startGroup()
Starts rendering a group, called before processing grouped elements
HTML_QuickForm2_Renderer_Proxy::startGroup()
Proxies for methods defined in HTML_QuickForm2_Renderer
HTML_QuickForm2_Renderer_Array::startGroup()
Implementations of abstract methods from HTML_QuickForm2_Renderer

Parameters:

HTML_QuickForm2_Node   $group   —  Group being rendered

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:34:59 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.