phpDocumentor SForm
Elements
[ class tree: SForm ] [ index: SForm ] [ all elements ]

Class: SForm_Elm_Checkable

Source Location: /SForm.php

Class SForm_Elm_Checkable

Class Overview

A base for checkbox or radio elements

Checkboxes and radio buttons have similar 'checked' attributes. Define them here so we don't pollute SForm_Element with unneeded methods.

Located in /SForm.php [line 3459]

SForm_Element
   |
   --SForm_Elm_Checkable
Author(s):
API Tags:
Abstract:  

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From SForm_Element

SForm_Element::$addName
SForm_Element::$attributes
SForm_Element::$defId
SForm_Element::$emptyTag
SForm_Element::$errors
SForm_Element::$filters
SForm_Element::$locked
SForm_Element::$parent
SForm_Element::$required
SForm_Element::$rules
SForm_Element::$tag
SForm_Element::$validated
SForm_Element::$valueSet

Inherited From SForm_Element

SForm_Element::__construct()
Construct with an identity. Optionally add a label and more attributes.
SForm_Element::addRule()
Add a rule to this element
SForm_Element::assignParent()
Assign this element's parent
SForm_Element::autoAK()
Generates an access key and updated label
SForm_Element::createRule()
Creates & returns a rule
SForm_Element::escHtml()
Escape HTML in a consistant manner
SForm_Element::filter()
Apply a filter to the value
SForm_Element::filterValue()
Filters the value
SForm_Element::freeze()
Set if this element is frozen
SForm_Element::getAttribute()
Get an attribute in $this
SForm_Element::getAttributesString()
Creates an HTML attribute string from an array
SForm_Element::getErrorHtml()
Do we have any errors?
SForm_Element::getGlobalId()
This is the page-wide unique ID
SForm_Element::getLabel()
Return the label string (no markup)
SForm_Element::getLabelHtml()
Return the label with markup added
SForm_Element::getLocalId()
A Locally usable ID
SForm_Element::getOption()
Get a global option
SForm_Element::getRequest()
Returns a value from the request
SForm_Element::getValue()
The value of this element
SForm_Element::isFrozen()
Is this element marked as frozen?
SForm_Element::isRequired()
Is this element required?
SForm_Element::lock()
Locks & adds any last minute stuff
SForm_Element::render()
Append this leaf element to the render queue
SForm_Element::setAttribute()
Set an attribute in $this
SForm_Element::setDefault()
Set the default value of this element
SForm_Element::setOption()
Set a global option
SForm_Element::setValue()
Set the value of this element
SForm_Element::toHidden()
Do we have any hidden tags to append?
SForm_Element::toHtml()
Create a HTML representation of this element
SForm_Element::toHtmlFin()
Close an open HTML tags
SForm_Element::toJavaScript()
Retrieve any JavaScript that should be run onsubmit
SForm_Element::toString()
How does this value look as a HTML string?
SForm_Element::unsetAttribute()
Unset an attribute
SForm_Element::validate()
Is this a valid element?
SForm_Element::wasSubmitted()
Was this form submitted?

[ Top ]
Property Summary
boolean   $checkedSet   Has the 'checked' attribute been explicitly set?

[ Top ]
Method Summary
boolean   isChecked()   Is this element checked?
void   setChecked()   Set the checked attribute
void   setDefault()   Set the default checked status
string   toHtml()   Returns a checkable element
string   toString()   Setup the string so it better represent a 'check'

[ Top ]
Properties
boolean   $checkedSet = false [line 3465]

Has the 'checked' attribute been explicitly set?

API Tags:
Usedby:  SForm_Elm_Checkable::isChecked()
Usedby:  SForm_Elm_Checkable::setChecked()
Access:  protected


[ Top ]
Methods
isChecked  [line 3515]

  boolean isChecked( )

Is this element checked?

Returns the current checked status of this element. Note that the checked status is different than the value of the checkable element. If an element is checked it returns its value. Otherwise, it returns no value.


API Tags:
Return:  Checked?
Usedby:  SForm_Elm_Checkable::toHtml()
Access:  public
Uses:  SForm_Elm_Checkable::$checkedSet


[ Top ]
setChecked  [line 3496]

  void setChecked( boolean $checked  )

Set the checked attribute

Set the checked status of this element. Note that the checked status is different than the value of the checkable element. If an element is checked it returns its value. Otherwise, it returns no value.

Parameters:
boolean   $checked:  Should we check it?

API Tags:
Access:  public
Uses:  SForm_Elm_Checkable::$checkedSet


[ Top ]
setDefault  [line 3475]

  void setDefault( boolean $checked  )

Set the default checked status

Sets the default status of this element. The default is ignored, though, if the status has been explicitly set via setChecked().

Parameters:
boolean   $checked:  Default status

API Tags:
Access:  public


Redefinition of:
SForm_Element::setDefault()
Set the default value of this element

[ Top ]
toHtml  [line 3553]

  string toHtml( )

Returns a checkable element

Checkboxes are odd in that they don't return any value if they are unchecked when submitted. So, we need to use isChecked() to determine the correct status of this checkbox.


API Tags:
Return:  Element HTML
Access:  public
Uses:  SForm_Elm_Checkable::isChecked()


Redefinition of:
SForm_Element::toHtml()
Create a HTML representation of this element

[ Top ]
toString  [line 3571]

  string toString( )

Setup the string so it better represent a 'check'


API Tags:
Return:  A static check.
Access:  public


Redefinition of:
SForm_Element::toString()
How does this value look as a HTML string?

[ Top ]

Documentation generated on Mon, 09 Apr 2007 19:08:34 -0500 by phpDocumentor 1.3.0