Zend Form Cheatsheet

View Helpers

formButton ($name, $value=null, $attribs=null)
formCheckbox ($name, $value=null, $attribs=null, array $checkedOptions=null)
formFile ($name, $attribs=null)
formHidden ($name, $value=null, array $attribs=null)
formImage ($name, $value=null, $attribs=null)
formMultiCheckbox ($name, $value=null, $attribs=null, $options=null, $listsep="<br />\n")
formNote ($name, $value=null)
formPassword ($name, $value=null, $attribs=null)
formRadio ($name, $value=null, $attribs=null, $options=null, $listsep="<br />\n")
formReset ($name= '', $value= 'Reset', $attribs=null)
formSelect ($name, $value=null, $attribs=null, $options=null, $listsep="<br />\n")
formTextarea ($name, $value=null, $attribs=null)

Decorators

Default Decorators:

Name

Options

- Errors

Captcha

- Description

Description

- HtmlTag

DtDdWrapper

- Label

Errors

Fieldset

File

Form

FormElements

FormErrors

HtmlTag

array('tag' => 'div');

Image

Label

PrepareElements

ViewHelper

ViewScript

Filters

Name

Returns

Options

Alnum

String

$allowWhitespace

Alpha

String

$allowWhitespace

Basename

Filename

Boolean

Boolean

Callback

Function Return

array('callback','options')

Compress

Compressed String or File

array('adapter','options')

Decompress

Decompressed String or File

Digets

[0-9]

Dir

Directory from File Path

Encrypt

Many

Decrypt

Many

HtmlEntities

HTML Encoded

array('quotestyle','charset','doublequote')

Int

intval()

LocalizedToNormalized

Removes Commas etc from Number/date

NormalizedToLocalized

Makes things pretty

Null

Null if conditions are met

array('type')

PregReplace

array('match','replace')

RealPath

RealPath()

array('exists' => true)

StringToLower

strtolower()

array('encoding')

StringToUpper

strtoupper()

array('encoding')

StringTrim

trim()

array('charlist')

StripNewLines

StripTags

Insecure strip tags

array('allowAttribs','allowTags')

Validators

Name

Allows

Options

Alnum

[A-z0-9]

$allowWhitespace

Alpha

[A-z]

$allowWhitespace

Barcode

Between

array('min','max','inclusive')

CreditCard

Date

array('format','locale')

Db_*

Digits

[0-9]

EmailAddress

array('allow','deep','domain','hostname','mx')

Float

Int or Float

array('locale')

GreaterThan

array('min')

Hex

[A-f0-9]

Hostname

Iban

Identical

array('strict' = true, 'token' => formElementName)

InArray

array('haystack','recursive','strict' = false)

Int

Integer

array('locale')

Ip

Ipv4|IPv6

Isbn

LessThan

array('max')

NotEmpty

array('type')

PostCode

$locale (en_GB)

Regex

array('pattern')

StringLength

array('encoding','min','max')

http://framework.zend.com/manual/en/zend.validate.set.html