API Documentation

Form/Decorator/ViewHelper.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Form
Classes
Zend_Form_Decorator_ViewHelper

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Form_Decorator_ViewHelper

Extends from
Zend_Form_Decorator_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Form
subpackage
Decorator
version
$Id: ViewHelper.php 20096 2010-01-06 02:05:09Z bkarwin $
Properties
$_buttonTypes
$_helper
Methods
setHelper
getHelper
getName
getElementAttribs
getValue
render

Description

Zend_Form_Decorator_ViewHelper

Decorate an element by using a view helper to render it.

Accepts the following options: - separator: string with which to separate passed in content and generated content - placement: whether to append or prepend the generated content to the passed in content - helper: the name of the view helper to use

Assumes the view helper accepts three parameters, the name, value, and optional attributes; these will be provided by the element.

Properties

$_buttonTypes

array $_buttonTypes = 'array'

Element types that represent buttons

Details

$_buttonTypes
array
visibility
protected
default
array
final
false
static
false

$_helper

string $_helper = ''

View helper to use when rendering

Details

$_helper
string
visibility
protected
default
final
false
static
false

Methods

getElementAttribs

getElementAttribs( ) : array

Retrieve element attributes

Set id to element name and/or array item.

Output
array
Details
visibility
public
final
false
static
false

getHelper

getHelper( ) : string

Retrieve view helper for rendering element

Output
string
Details
visibility
public
final
false
static
false

getName

getName( ) : string

Get name

If element is a Zend_Form_Element, will attempt to namespace it if the element belongs to an array.

Output
string
Details
visibility
public
final
false
static
false

getValue

getValue( Zend_Form_Element $element ) : string|null

Get value

If element type is one of the button types, returns the label.

Arguments
$element
Zend_Form_Element
Output
string|null
Details
visibility
public
final
false
static
false

render

render( string $content ) : string

Render an element using a view helper

Determine view helper from 'viewHelper' option, or, if none set, from the element type. Then call as helper($element->getName(), $element->getValue(), $element->getAttribs())

Arguments
$content
string
Output
string
Details
visibility
public
final
false
static
false
throws
if element or view are not registered

setHelper

setHelper( string $helper ) : Zend_Form_Decorator_Element_ViewHelper

Set view helper to use when rendering

Arguments
$helper
string
Output
Zend_Form_Decorator_Element_ViewHelper
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.