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

Class: HTML_QuickForm2_Controller_Page

Source Location: /HTML_QuickForm2-2.1.0/HTML/QuickForm2/Controller/Page.php

Class Overview


Class representing a page of a multipage form


Author(s):

Version:

  • Release: 2.1.0

Variables

Methods


Child classes:

SimplePage
Class representing a page of a multipage form
TabbedPage
Class representing a page of a multipage form
PageFirst
Class representing a page of a multipage form
PageSecond
Class representing a page of a multipage form
PageThird
Class representing a page of a multipage form

Inherited Variables

Inherited Methods


Class Details

[line 37]
Class representing a page of a multipage form

Unlike old HTML_QuickForm_Controller, this does not extend HTML_QuickForm2 but accepts an instance of that in the constructor. You need to create a subclass of this class and implement its populateForm() method.



[ Top ]


Class Variables

$controller =  null

[line 60]

Controller this page belongs to
  • Access: protected



[ Top ]

$form =  null

[line 54]

The form wrapped by this page
  • Access: protected

Type:   HTML_QuickForm2


[ Top ]

$handlers = array()

[line 66]

Contains the mapping of action names to handlers (objects implementing HTML_QuickForm2_Controller_Action)
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 73]

HTML_QuickForm2_Controller_Page __construct( HTML_QuickForm2 $form)

Class constructor, accepts the form to wrap around
  • Access: public

Parameters:

HTML_QuickForm2   $form   — 

[ Top ]

addHandler   [line 114]

void addHandler( string $actionName, HTML_QuickForm2_Controller_Action $action)

Adds a handler for a specific action
  • Access: public

Parameters:

string   $actionName   —  action name
HTML_QuickForm2_Controller_Action   $action   —  the handler for the action

[ Top ]

getButtonName   [line 146]

string getButtonName( string $actionName)

Returns a name for a submit button that will invoke a specific action
  • Return: "name" attribute for a submit button
  • Access: public

Parameters:

string   $actionName   —  Name of the action

[ Top ]

getController   [line 103]

HTML_QuickForm2_Controller getController( )

Returns the controller owning this page
  • Access: public

[ Top ]

getForm   [line 83]

HTML_QuickForm2 getForm( )

Returns the form this page wraps around
  • Access: public

[ Top ]

handle   [line 130]

mixed handle( string $actionName)

Handles an action

If the page does not contain a handler for this action, controller's handle() method will be called.

  • Return: Return value of action handler
  • Throws: HTML_QuickForm2_NotFoundException if handler for an action is missing
  • Access: public

Parameters:

string   $actionName   —  Name of the action

[ Top ]

populateForm   [line 222]

void populateForm( )

Populates the form with the elements

The implementation of this method in your subclass of HTML_QuickForm2_Controller_Page should contain all the necessary addElement(), addRule() etc. calls. The method will only be called if needed to prevent wasting resources on the forms that aren't going to be seen by the user.

  • Abstract:
  • Access: protected

Overridden in child classes as:

SimplePage::populateForm()
PageFoo::populateForm()
PageBar::populateForm()
PageBaz::populateForm()
PageFirst::populateForm()
PageSecond::populateForm()
PageThird::populateForm()

[ Top ]

populateFormOnce   [line 199]

void populateFormOnce( )

Wrapper around populateForm() ensuring that it is only called once
  • Access: public

[ Top ]

setController   [line 93]

void setController( HTML_QuickForm2_Controller $controller)

Sets the controller owning the page
  • Access: public

Parameters:

HTML_QuickForm2_Controller   $controller   —  controller the page belongs to

[ Top ]

setDefaultAction   [line 163]

HTML_QuickForm2_Controller_DefaultAction setDefaultAction( string $actionName, [string $imageSrc = 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='])

Sets the default action invoked on page-form submit

This is necessary as the user may just press Enter instead of clicking one of the named submit buttons and then no action name will be passed to the script.

  • Return: Returns the image input used for default action
  • Access: public

Parameters:

string   $actionName   —  Default action name
string   $imageSrc   —  Path to a 1x1 transparent GIF image

[ Top ]

storeValues   [line 231]

bool storeValues( [bool $validate = true])

Stores the form values (and validation status) is session container
  • Return: Validation status for the page
  • Access: public

Parameters:

bool   $validate   —  Whether to store validation status

[ Top ]


Documentation generated on Wed, 10 Apr 2019 08:56:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.