\ValidFormBuilderValidWizard

ValidWizard class - Create multiple pages with formfields and next - previous buttons

Note: Make sure you also include validwizard.js when using ValidWizard. This javascript library is not required when you're not using ValidWizard.

Example; Create a ValidWizard instance

// The signature is exactly the same as with ValidForm
$objForm = new ValidWizard(
    "awesome-wizard",
    "Please fill out my cool wizard",
    "/stuff",
    array(
        // When no 'nextLabel' meta is set, defaults to 'Next →'
        "nextLabel" => "Move on →",
        // When no 'previousLabel' meta is set, defaults to '← Previous'
        "previousLabel" => "Retreat!"
    )
);

Example 2; Add a page

$objForm->addPage(
    "personal-details",
    "Personal Details"
);

Summary

Methods
Properties
Constants
__construct()
setDefaults()
addHtml()
addNavigation()
addFieldset()
addHiddenField()
renderField()
addField()
addParagraph()
addButton()
addArea()
addMultiField()
addJSEvent()
toHtml()
fieldsToHtml()
toJs()
serialize()
unserialize()
isSubmitted()
getCachedFields()
getFields()
getValidField()
getInvalidFields()
isValid()
valuesAsHtml()
fieldsetAsHtml()
generateId()
getUniqueId()
get()
getIsSet()
getHttpBodyValue()
getStrippedClassName()
getPage()
addPage()
addConfirmPage()
removeConfirmPage()
hasConfirmPage()
isValidUntil()
getInvalidFieldsUntil()
getPageCount()
getCurrentPage()
getPreviousLabel()
setPreviousLabel()
getNextLabel()
setNextLabel()
getDescription()
setDescription()
getMeta()
setMeta()
getDefaults()
getAction()
setAction()
setUseCsrfProtection()
getSubmitLabel()
setSubmitLabel()
getJsEvents()
setJsEvents()
getElements()
setElements()
getName()
setName()
getMainAlert()
setMainAlert()
getRequiredStyle()
setRequiredStyle()
getNoValuesMessage()
setNoValuesMessage()
setCachedFields()
setUniqueId()
No public properties found
VFORM_STRING
VFORM_TEXT
VFORM_NUMERIC
VFORM_INTEGER
VFORM_WORD
VFORM_EMAIL
VFORM_PASSWORD
VFORM_SIMPLEURL
VFORM_FILE
VFORM_BOOLEAN
VFORM_RADIO_LIST
VFORM_CHECK_LIST
VFORM_SELECT_LIST
VFORM_PARAGRAPH
VFORM_CURRENCY
VFORM_DATE
VFORM_CUSTOM
VFORM_CUSTOM_TEXT
VFORM_HTML
VFORM_URL
VFORM_HIDDEN
VFORM_COMPARISON_EQUAL
VFORM_COMPARISON_NOT_EQUAL
VFORM_COMPARISON_EMPTY
VFORM_COMPARISON_NOT_EMPTY
VFORM_COMPARISON_LESS_THAN
VFORM_COMPARISON_GREATER_THAN
VFORM_COMPARISON_LESS_THAN_OR_EQUAL
VFORM_COMPARISON_GREATER_THAN_OR_EQUAL
VFORM_COMPARISON_CONTAINS
VFORM_COMPARISON_DOES_NOT_CONTAIN
VFORM_COMPARISON_STARTS_WITH
VFORM_COMPARISON_ENDS_WITH
VFORM_COMPARISON_REGEX
VFORM_MATCH_ALL
VFORM_MATCH_ANY
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

VFORM_STRING

VFORM_STRING = 1 : \ValidFormBuilder\number

Input type[text] with standard string validation

VFORM_TEXT

VFORM_TEXT = 2 : \ValidFormBuilder\number

Textarea element type

VFORM_NUMERIC

VFORM_NUMERIC = 3 : \ValidFormBuilder\number

Input type[text] with numeric validation

VFORM_INTEGER

VFORM_INTEGER = 4 : \ValidFormBuilder\number

Input type[text] with integer validation

VFORM_WORD

VFORM_WORD = 5 : \ValidFormBuilder\number

Input type[text] with single word validation

VFORM_EMAIL

VFORM_EMAIL = 6 : \ValidFormBuilder\number

Input type[text] with email validation

VFORM_PASSWORD

VFORM_PASSWORD = 7 : \ValidFormBuilder\number

Input type[password]

VFORM_SIMPLEURL

VFORM_SIMPLEURL = 8 : \ValidFormBuilder\number

Input type[text] with basic URL validation

VFORM_FILE

VFORM_FILE = 9 : \ValidFormBuilder\number

Input type[file]

VFORM_BOOLEAN

VFORM_BOOLEAN = 10 : \ValidFormBuilder\number

Input type[radio]

VFORM_RADIO_LIST

VFORM_RADIO_LIST = 12 : \ValidFormBuilder\number

Group element. Each added element is an input[type=radio]

VFORM_CHECK_LIST

VFORM_CHECK_LIST = 13 : \ValidFormBuilder\number

Group element. Each added element is an input[type=checkbox]

VFORM_SELECT_LIST

VFORM_SELECT_LIST = 14 : \ValidFormBuilder\number

Group element. Each added element is an option element

VFORM_PARAGRAPH

VFORM_PARAGRAPH = 15 : \ValidFormBuilder\number

Not an element. This creates a paragraph in between form fields.

VFORM_CURRENCY

VFORM_CURRENCY = 16 : \ValidFormBuilder\number

Input element

VFORM_DATE

VFORM_DATE = 17 : \ValidFormBuilder\number

Input type[text] with European date validation (dd/mm/yyyy)

VFORM_CUSTOM

VFORM_CUSTOM = 18 : \ValidFormBuilder\number

Input type[text] with custom regular expression validation

VFORM_CUSTOM_TEXT

VFORM_CUSTOM_TEXT = 19 : \ValidFormBuilder\number

Textarea with custom regular expression validation

VFORM_HTML

VFORM_HTML = 20 : \ValidFormBuilder\number

Textarea with basic input validation + HTML tags allowed

VFORM_URL

VFORM_URL = 21 : \ValidFormBuilder\number

Input type[text] with url validation

VFORM_HIDDEN

VFORM_HIDDEN = 22 : \ValidFormBuilder\number

Input type[hidden]

VFORM_COMPARISON_EQUAL

VFORM_COMPARISON_EQUAL = "equal" : string

Check if this value is equal (case insensitive)

VFORM_COMPARISON_NOT_EQUAL

VFORM_COMPARISON_NOT_EQUAL = "notequal" : string

Check if this value is **not** equal (case insensitive)

VFORM_COMPARISON_EMPTY

VFORM_COMPARISON_EMPTY = "empty" : \ValidFormBuilder\stringq

Check if this value is empty

VFORM_COMPARISON_NOT_EMPTY

VFORM_COMPARISON_NOT_EMPTY = "notempty" : string

Check if this value is **not** empty

VFORM_COMPARISON_LESS_THAN

VFORM_COMPARISON_LESS_THAN = "lessthan" : string

Check if this value is less than

VFORM_COMPARISON_GREATER_THAN

VFORM_COMPARISON_GREATER_THAN = "greaterthan" : string

Check if this value is greater than

VFORM_COMPARISON_LESS_THAN_OR_EQUAL

VFORM_COMPARISON_LESS_THAN_OR_EQUAL = "lessthanorequal" : string

Check if this value is less than or equal

VFORM_COMPARISON_GREATER_THAN_OR_EQUAL

VFORM_COMPARISON_GREATER_THAN_OR_EQUAL = "greaterthanorequal" : string

Check if this value is greater than or equal

VFORM_COMPARISON_CONTAINS

VFORM_COMPARISON_CONTAINS = "contains" : string

Check if the value contains this string (case insensitive)

VFORM_COMPARISON_DOES_NOT_CONTAIN

VFORM_COMPARISON_DOES_NOT_CONTAIN = "doesnotcontain" : string

Check if the value does not contain this string (case insensitive)

VFORM_COMPARISON_STARTS_WITH

VFORM_COMPARISON_STARTS_WITH = "startswith" : string

Check if the value **starts** with this string

VFORM_COMPARISON_ENDS_WITH

VFORM_COMPARISON_ENDS_WITH = "endswith" : string

Check if the value **ends** with this string

VFORM_COMPARISON_REGEX

VFORM_COMPARISON_REGEX = "regex" : string

Check if the value matches your own custom regular expression

VFORM_MATCH_ALL

VFORM_MATCH_ALL = "all" : string

ValidForm Condition match

Match all of the defined conditions

VFORM_MATCH_ANY

VFORM_MATCH_ANY = "any" : string

ValidForm Condition match

Match any of the defined conditions

Methods

__construct()

__construct(string  $name, string  $description = null, string|null  $action = null, array  $meta = array()) 

Create an instance of the ValidForm Builder

Parameters

string $name

The name and id of the form in the HTML DOM and JavaScript.

string $description

Desriptive text which is displayed above the form. Default null

string|null $action

Form action. If left empty the form will post to itself. Default null

array $meta

The meta array

setDefaults()

setDefaults(array  $arrDefaults = array()) 

Use an array to set default values on all the forms children.

The array's keys should be the form name to set the default value of, the value is the actual value or values to set.

Example 1 - Basic defaults:

//*** The form
$objCheck = $objForm->addField("cool", "Coolest PHP Library", ValidForm::VFORM_STRING);

//*** Set field 'cool' default value to "ValidForm Builder"
$objForm->setDefaults([
    "cool" => "ValidForm Builder"
]);

Example 2 - An array of defaults:

//*** The form
$objCheck = $objForm->addField("cool", "Cool checklist", ValidForm::VFORM_CHECK_LIST);
$objCheck->addField("Option 1", "option1");
$objCheck->addField("Option 2", "option2");
$objCheck->addField("Option 3", "option3");

$objCheck = $objForm->addField("cool-text", "Coolest PHP Library", ValidForm::VFORM_STRING);

//*** Check options 2 and 3 by default using setDefaults()
$objForm->setDefaults([
    "cool-text" => "ValidForm Builder",
    "cool" => ["option2", "option3"]
]);

Parameters

array $arrDefaults

The array of default values. Keys are field names, values strings or arrays

Throws

\InvalidArgumentException

addHtml()

addHtml(string  $html) : \ValidFormBuilder\StaticText

Injects a string in the form.

Use this to add an extra string in the form. For instance, you can create an input field like this:

Enter the amount:   $ _____

In this example, we used StaticText to inject the dollar sign before our input field.

Parameters

string $html

The string or HTML code to inject

Returns

\ValidFormBuilder\StaticText

addNavigation()

addNavigation(array  $meta = array()) : \ValidFormBuilder\Navigation

Add 'navigation' to the form. By navigation we mean a 'navigation div' at the buttom of the form containing the submit button. This method is optional for customization purposes -- navigation is created automatically.

Parameters

array $meta

Array with meta data. Only the "style" attribute is supported as for now.

Returns

\ValidFormBuilder\Navigation

addFieldset()

addFieldset(string  $header = null, string  $noteHeader = null, string  $noteBody = null, array  $meta = array()) : \ValidFormBuilder\Fieldset

Add a fieldset

See \ValidFormBuilder\ValidForm::addFieldset()

Parameters

string $header

The header for this fieldset

string $noteHeader

An optional header for the 'note' block on the side of this fieldset

string $noteBody

The optional body for the 'note block on the side of this fieldset

array $meta

The meta array

Returns

\ValidFormBuilder\Fieldset

addHiddenField()

addHiddenField(string  $name, string  $type, array  $meta = array(), boolean  $blnJustRender = false) : \ValidFormBuilder\Hidden

Add a hidden input field to the form collection.

Hidden fields can be used for example to inject custom values in your post data and still have them validated using ValidForm Builder.

Parameters

string $name

The hidden field's name attribute

string $type

Define a validation type using one of the ValidForm::VFORM_ constants. This does not influence the fact that you're creating a hidden field. This is only used for validation of the hidden field's content.

array $meta

Optional meta array

boolean $blnJustRender

If true, only create a {@link \ValidFormBuilder\Hidden} instance and return it. When false, this {@link \ValidFormBuilder\Hidden} instance is added to the internal elements collection and will be parsed when toHtml() is called.

Returns

\ValidFormBuilder\Hidden

renderField()

renderField(string  $name, string  $label, integer  $type, array  $validationRules, array  $errorHandlers, array  $meta) : \ValidFormBuilder\Element

Use this utility method to only render \ValidFormBuilder\Element instances of the defined types.

Elements rendered with this method aren't added to the internal elements collection.

Parameters

string $name

The element's name

string $label

The element's label

integer $type

The element's validation type

array $validationRules

Optional.Custom validation rules array

array $errorHandlers

Custom error handling array

array $meta

Optional. Meta data array

Returns

\ValidFormBuilder\Element

Returns null when no valid type is defined

addField()

addField(string  $name, string  $label, integer  $type, array  $validationRules = array(), array  $errorHandlers = array(), array  $meta = array(), boolean  $blnJustRender = false) : \ValidFormBuilder\Element

Add a field

See \ValidFormBuilder\ValidForm::addField()

Parameters

string $name

The element's name

string $label

The element's label

integer $type

The element's validation type

array $validationRules

Optional.Custom validation rules array

array $errorHandlers

Custom error handling array

array $meta

Optional. Meta data array

boolean $blnJustRender

When true, the element is not added to the internal elements collection. addField() with $blnJustRender set to true is exactly the same as calling ValidForm::renderField()

Returns

\ValidFormBuilder\Element

Returns null when no valid type is defined

addParagraph()

addParagraph(string  $strBody, string  $strHeader = "", array  $meta = array()) : \ValidFormBuilder\Paragraph

Adds a \ValidFormBuilder\Paragraph object to the internal elements collection.

This renders a paragraph inside the form. Formfields can be added before and after the paragraph. Example:

$objForm->addField("name", "Your Name", ValidForm::VFORM_STRING);
$objForm->addParagraph("Next, you should enter your last name.", "Enter your name!");
$objForm->addField("last-name", "Last Name", ValidForm::VFORM_STRING);

Parameters

string $strBody

Paragraph body

string $strHeader

Optional header above the paragraph

array $meta

Custom meta array

Returns

\ValidFormBuilder\Paragraph

addButton()

addButton(string  $strLabel, array  $arrMeta = array()) : \ValidFormBuilder\Button

Adds a <button> element to the internal fields collection.

For an example; see \ValidFormBuilder\Button

Parameters

string $strLabel

The button's label

array $arrMeta

The meta array

Returns

\ValidFormBuilder\Button

addArea()

addArea(string  $label = null, string  $active = false, string  $name = null, string  $checked = false, array  $meta = array()) : \ValidFormBuilder\Area

Add an area to the internal elements collection.

See \ValidFormBuilder\Area for examples

Parameters

string $label

The title of this area

string $active

If true, the title has a checkbox which can enable or disable all child elements

string $name

The ID of this area

string $checked

Use in combination with $active; if true, the checkbox will be checked by default

array $meta

The meta array

Returns

\ValidFormBuilder\Area

addJSEvent()

addJSEvent(string  $strEvent, string  $strMethod) 

Add a custom javascript event with corresponding callback function

With this method you can either register a custom callback function on one of the predefined custom events or you can register the callback function on a jQuery bindable event (e.g. jQuery().bind(eventName, callback)).

These are predefined event hooks in the ValidForm Builder client-side library:

  • beforeSubmit
  • beforeNextPage
  • afterNextPage
  • beforePreviousPage
  • afterPreviousPage
  • beforeAddPreviousButton
  • afterAddPreviousButton
  • beforeShowPage
  • afterShowPage
  • beforeAddPageNavigation
  • afterAddPageNavigation
  • beforeDynamicChange
  • afterDynamicChange
  • afterValidate

Parameters

string $strEvent

The event name

string $strMethod

The name of the callback function

toHtml()

toHtml(string  $blnClientSide = true, string  $blnForceSubmitted = null, string  $strCustomJs = "") : string

Generate HTML output - build form

Parameters

string $blnClientSide

Render javascript code or not, defaults to true

string $blnForceSubmitted

This forces the form rendering as if the fields are submitted

string $strCustomJs

Inject custom javascript to be executed while initializing ValidForm Builder client-side.

Returns

string —

Generated HTML output

fieldsToHtml()

fieldsToHtml(string  $blnForceSubmitted = false, string  $blnNavigation = false) : string

This method generates HTML output for the current internal elements collection.

This method is mostly used internally in the library and it's therefore not recommended to use this except for these rare occasions when you only want the rendered fields an not all the meta surrounding the fields like the form tag, description element and form error message.

Parameters

string $blnForceSubmitted

This forces the form rendering as if the fields are submitted

string $blnNavigation

This is a reference returning true if the form contains a navigation element

Returns

string —

Generated HTML output

toJs()

toJs(string  $strCustomJs = "") : string

Generate the Javascript output only.

This is particulary useful when using ValidForm Builder in combination with AJAX form handling. In that case you don't want to output the HTML together with the javascript.

Parameters

string $strCustomJs

Inject custom javascript to be executed while initializing ValidForm Builder client-side.

Returns

string

serialize()

serialize(boolean  $blnSubmittedValues = true) : String

Serialize, compress and encode the entire form including it's values

Parameters

boolean $blnSubmittedValues

Whether or not to include submitted values or only serialize default values.

Returns

String —

Base64 encoded, gzcompressed, serialized form.

unserialize()

unserialize(string  $strSerialized, string  $strUniqueId = "") : \ValidFormBuilder\ValidForm

Unserialize a previously serialized ValidWizard object

Parameters

string $strSerialized

Serialized ValidWizard object

string $strUniqueId

Use this to overwrite the deserialized wizard's unique ID

Returns

\ValidFormBuilder\ValidForm

A ValidForm instance (this can either be a ValidForm or ValidWizard object)

isSubmitted()

isSubmitted(boolean  $blnForce = false) : boolean

Check if the wizard is submitted

See \ValidFormBuilder\ValidForm::isSubmitted()

Parameters

boolean $blnForce

Fake isSubmitted to true to force field values.

Returns

boolean

getCachedFields()

getCachedFields() : \ValidFormBuilder\Collection

Fetch a cached flat collection of form fields instead of making an expensive getFields() call and looping through all elements

Returns

\ValidFormBuilder\Collection

getFields()

getFields() : \ValidFormBuilder\Collection

Get a flat Collection of all internal elements.

This loops through all elements and adds each element and their children to a new Collection which will be returned. This results in a flat Collection filled with ValidForm Builder elements.

Returns

\ValidFormBuilder\Collection

getValidField()

getValidField(string  $id) : \ValidFormBuilder\Ambigous

Get a valid field object.

This is about the most important method of ValidForm Builder. Use this to get a valid field after validation to fetch it's validated value.

Example:

$objForm = new ValidForm('example');

$objForm->addField('test', 'Test field', ValidForm::VFORM_STRING);

if ($objForm->isSubmitted() && $objForm->isValid()) {
    $strTest = $objForm->getValidField("test")->getValue();
    // $strTest now contains the validated value of the 'test' field which is safe for database storage etc.

    $strOutput = "Test value is: " . $strTest;
} else {
    $strOutput = $objForm->toHtml();
}

Parameters

string $id

Returns

\ValidFormBuilder\Ambigous —

<NULL, Base>

getInvalidFields()

getInvalidFields() : array

Get an associative array of invalid field names (the array's keys) and the error message (the values)

This method is very useful when using ValidForm Builder with AJAX empowered forms. Example:

//*** The basic form set-up
$objForm = new ValidForm('ajaxForm');

$objForm->addField(
    'firstName',
    'First name',
    ValidForm::VFORM_STRING,
    array(
        'required' => true
    ),
    array(
        'required' => 'This field is required'
    )
);
$objForm->addField(
    'lastName',
    'Last name',
    ValidForm::VFORM_STRING
);
$objForm->addField(
    'emailAddress',
    'E-mail address',
    ValidForm::VFORM_EMAIL,
    array(),
    array(
        'type' => 'Invalid e-mail address'
    )
);

//*** Form handling
if ($objForm->isSubmitted() && $objForm->isValid()) {
    // Form is submitted and valid, do stuff with the validated values
} elseif ($objForm->isSubmitted()) {
    // Form is submitted but not valid, return the invalid fields array as a response:
    $strOutput = json_encode(
        $objForm->getInvalidFields()
    );
} else {
    // Form is not even submitted, show regular parsed form
    $strOutput = $objForm->toHtml();
}

Assuming we've posted the following values (and managed to bypass client-side validation):

  • firstName: ''
  • lastName: 'van Baalen'
  • emailAddress: 'Robin Hood'

The following would be a response from getInvalidFields():

array(
    'firstName' => 'This field is required',
    'emailAddress' => 'Invalid e-mail address'
)

Returns

array

isValid()

isValid(null  $strPageId = null) : boolean

See {@link \ValidFormBuilder\ValidForm::isValid()}

Parameters

null $strPageId

Optional. If page ID is given, only that page will be validated.

Returns

boolean —

True if successful, false if one of the fields contains an error.

valuesAsHtml()

valuesAsHtml(boolean  $hideEmpty = false, string  $collection = null) : string

Generate valuesAsHtml overview

See \ValidFormBuilder\ValidForm::valuesAsHtml()

Parameters

boolean $hideEmpty

Set to true to hide empty field values from the overview. Defaults to false.

string $collection

Optional - advanced usage only; a custom Collection of elements to parse

Returns

string —

Generated table with label: value pairs

fieldsetAsHtml()

fieldsetAsHtml(\ValidFormBuilder\Fieldset  $objFieldset, string  $strSet, boolean  $hideEmpty = false) : string

Generates HTML output for all fieldsets and their children elements.

This method is hardly used in the public API. The only reason why this is a public method is to enable customization through class extension.

Parameters

\ValidFormBuilder\Fieldset $objFieldset

The Fieldset object to parse

string $strSet

Previously generated HTML

boolean $hideEmpty

Set to true to hide empty field values from the overview. Defaults to false.

Returns

string —

Generated HTML

generateId()

generateId(integer  $intLength = 8) : string

Generate a unique ID

Parameters

integer $intLength

ID length

Returns

string —

Generated ID

getUniqueId()

getUniqueId() : string

Returns the auto-generated unique ID of this form instance.

Returns

string

get()

get(string  $param, string  $replaceEmpty = "") : \ValidFormBuilder\Ambigous

Read parameters from the `$_REQUEST` array and body string with an optional fallback value

Parameters

string $param

The parameter to read

string $replaceEmpty

Optional replace value when parameter is not available or empty

Returns

\ValidFormBuilder\Ambigous —

<string, array>

getIsSet()

getIsSet(string  $param) : boolean

Read parameters from the `$_REQUEST` array and body string and determine if it is "set".

Parameters

string $param

The parameter to read

Returns

boolean

getHttpBodyValue()

getHttpBodyValue(string  $param, string  $varReplaceNotSet = null) : \ValidFormBuilder\Ambigous

Get the value of a form field from the raw HTTP body. This is used for PUT and DELETE HTTP methods.

Parameters

string $param

The parameter to read

string $varReplaceNotSet

Optional replace value when parameter is not set in the body

Returns

\ValidFormBuilder\Ambigous —

<string, array>

getStrippedClassName()

getStrippedClassName(string  $classname) : string

Returns the class name and strips off the namespace.

Parameters

string $classname

The classname with optional namespace reference

Returns

string —

Only the classname without the namespace.

getPage()

getPage(Integer  $intPage = 1) : \ValidFormBuilder\Page

Get a page from the collection based on it's zero-based position in the elements collection

Parameters

Integer $intPage

The page number, starting at 1.

Returns

\ValidFormBuilder\Page

Page element, if found.

addPage()

addPage(string  $id = "", string  $header = "", array  $meta = array()) : \ValidFormBuilder\Page

Add a page to the wizard

See \ValidFormBuilder\Page

Parameters

string $id

Page ID

string $header

Page title

array $meta

Meta array

Returns

\ValidFormBuilder\Page

addConfirmPage()

addConfirmPage() 

Set confirmpage flag to true.

This allows for client-side confirmation page injection. More details on this will follow.

removeConfirmPage()

removeConfirmPage() 

Reset the confirm page flag back to false

hasConfirmPage()

hasConfirmPage() : boolean

Check if this Wizard has a confirm page flag set.

Returns

boolean

isValidUntil()

isValidUntil(string  $strPageId) : boolean

Validate all form fields EXCLUDING the fields in the given page object and beyond.

This is useful when partially validating the wizard

Parameters

string $strPageId

The page object id

Returns

boolean —

True if all fields validate, false if not.

getInvalidFieldsUntil()

getInvalidFieldsUntil(string  $strPageId) : array

Validate all form fields EXCLUDING the fields in the given page object and beyond.

Parameters

string $strPageId

Returns

array —

Array of invalid fields

getPageCount()

getPageCount() : integer

Returns the number of pages in the wizard

Returns

integer

getCurrentPage()

getCurrentPage() : integer

Returns the current page counter

Returns

integer

getPreviousLabel()

getPreviousLabel() : string

Returns the label of the previous button

Returns

string

setPreviousLabel()

setPreviousLabel(mixed  $strLabel) : void

Sets the label of the previous button

Parameters

mixed $strLabel

getNextLabel()

getNextLabel() : string

Returns the label of the next button

Returns

string

setNextLabel()

setNextLabel(mixed  $strLabel) : void

Sets the label of the next button

Parameters

mixed $strLabel

getDescription()

getDescription() : string

Returns the value of $__description

Returns

string

setDescription()

setDescription(string  $strDescription) : void

Overwrites the value of $__description

Parameters

string $strDescription

getMeta()

getMeta() : array

Returns the value of $__meta

Returns

array

setMeta()

setMeta(array  $arrMeta) : void

Overwrites the value of $__meta

Parameters

array $arrMeta

getDefaults()

getDefaults() : array

Returns the value of $__defaults

Returns

array

getAction()

getAction() : string

Returns the value of $__action

Returns

string

setAction()

setAction(string  $strFormAction) : void

Overwrites the value of $__action

Parameters

string $strFormAction

setUseCsrfProtection()

setUseCsrfProtection(boolean  $value) : void

Overwrites the value of $__usecsrfprotection

Parameters

boolean $value

getSubmitLabel()

getSubmitLabel() : string

Returns the value of $__submitlabel

Returns

string

setSubmitLabel()

setSubmitLabel(string  $strSubmitLabel) : void

Overwrites the value of $__submitlabel

Parameters

string $strSubmitLabel

getJsEvents()

getJsEvents() : array

Returns the value of $__jsevents

Returns

array

setJsEvents()

setJsEvents(array  $arrJsEvents) : void

Overwrites the value of $__jsevents. Not recommended use {@link ValidForm::addJsEvent()} instead.

Parameters

array $arrJsEvents

getElements()

getElements() : \ValidFormBuilder\Collection

Returns the internal elements collection

Returns

\ValidFormBuilder\Collection

setElements()

setElements(\Collection  $objCollection) : void

Overwrites the internal elements collection.

Parameters

\Collection $objCollection

getName()

getName() : string

Returns the name of this ValidForm instance

Returns

string

setName()

setName(string  $strName) : void

Overwrites the name of this ValidForm instance

Parameters

string $strName

getMainAlert()

getMainAlert() : string

Returns the main alertof this ValidForm instance

Returns

string

setMainAlert()

setMainAlert(string  $strMainAlert) : void

Overwrites the main alert of this ValidForm instance

Parameters

string $strMainAlert

getRequiredStyle()

getRequiredStyle() : string

Returns the value of $__requiredstyle

Returns

string

setRequiredStyle()

setRequiredStyle(string  $strRequiredStyle) : void

Overwrites the value of $__requiredstyle.

Parameters

string $strRequiredStyle

getNoValuesMessage()

getNoValuesMessage() : string

Returns the value of $__novaluesmessage

Returns

string

setNoValuesMessage()

setNoValuesMessage(string  $strNoValuesMessage) : void

Overwrites the value of $__novaluesmessage.

Parameters

string $strNoValuesMessage

setCachedFields()

setCachedFields(\Collection  $objCollection) : void

Overwrites the value of $__cachedfields. Not recommended for API use

Parameters

\Collection $objCollection

setUniqueId()

setUniqueId(string  $strUniqueId) : void

Overwrites the value of $__uniqueid.

Parameters

string $strUniqueId