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

Class: HTML_QuickForm2_Controller_Page

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

Class Overview


Class representing a page of a multipage form


Author(s):

Version:

  • Release: 2.0.0

Variables

Methods


Child classes:

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
TabbedPage
Class representing a page of a multipage form
SimplePage
Class representing a page of a multipage form

Inherited Variables

Inherited Methods


Class Details

[line 61]
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 84]

Controller this page belongs to
  • Access: protected



[ Top ]

$form =  null

[line 78]

The form wrapped by this page
  • Access: protected

Type:   HTML_QuickForm2


[ Top ]

$handlers = array()

[line 90]

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

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 97]

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 138]

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 170]

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 127]

HTML_QuickForm2_Controller getController( )

Returns the controller owning this page
  • Access: public

[ Top ]

getForm   [line 107]

HTML_QuickForm2 getForm( )

Returns the form this page wraps around
  • Access: public

[ Top ]

handle   [line 154]

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 246]

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:

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

[ Top ]

populateFormOnce   [line 223]

void populateFormOnce( )

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

[ Top ]

setController   [line 117]

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 187]

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 255]

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 Tue, 26 Jun 2012 15:30:25 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.