constructor __construct [line 125]
void __construct(
string
$name, [array
$arguments = null])
|
|
Constructor
Tags:
Parameters:
method addAttribute [line 360]
Adds an HTML attribute to the attributes stack.
Implements a fluent interface pattern.
Tags:
Parameters:
method addFilter [line 520]
Adds filter object to Formagic item
Formagic items can have multiple filters which will be applied in the order they are passed to the object.
First parameter $filter can either be a string or an object of a class that extends Formagic_Filter_Interface. A string value is assumed to be the type of filter to be added.
This method throws an exception if no valid role object can be identified.
Implements a fluent interface pattern.
Tags:
Overridden in child classes as:
- Formagic_Item_Container::addFilter()
- Adds a filter to this container and all contained items.
Parameters:
method addRule [line 485]
Adds rule object to Formagic item
Formagic items can have multiple rules which will be applied in the order they are passed to the object.
First parameter $rule can either be a string or an instance of a class that extends Formagic_Rule_Abstract. A string value is assumed to be the type of rule to be added.
Implements a fluent interface pattern.
Tags:
Overridden in child classes as:
- Formagic_Item_Container::addRule()
- Adds a rule to this container and all contained items.
Parameters:
method getAttribute [line 393]
string getAttribute(
$name)
|
|
Returns the attributes array for this item.
Tags:
Parameters:
method getAttributes [line 373]
Returns the attributes array for this item.
Tags:
method getAttributeStr [line 444]
string getAttributeStr(
)
|
|
Returns attribute string for HTML tag.
Takes the attributes array and transforms it into a string that can be directly inserted into a HTML tag. The string will be built with a trailing space character.
Two default attributes are added to the attributes string: 'name' and 'id'. If you want to skip these, add them to your attributes on item generation or via setAttributes() or addAttribute() with NULL as value.
echo '<input type="text"' . $string . ' />';
// output will be:
// <input type="text" id="item" name="item" class="myclass" onclick="alert('Formagic');" />
Tags:
method getHtml [line 302]
method getLabel [line 291]
method getName [line 233]
Returns the item name.
Tags:
method getUnfilteredValue [line 243]
mixed getUnfilteredValue(
)
|
|
Returns current unfiltered value for this item.
Tags:
method getValue [line 253]
method getViolatedRules [line 630]
array getViolatedRules(
)
|
|
Returns array of violated rules.
If no rules were violated or if no validation has been performed yet, an empty array will be returned.
Tags:
method hasFilter [line 541]
boolean hasFilter(
string
$filterName)
|
|
Tags:
Parameters:
method hasRule [line 572]
boolean hasRule(
$ruleName, string
$rule)
|
|
Tells if a rule exists for this item.
The $ruleName parameter has to be a string with the name of rule that is looked for. If you want to know for example if the item has the mandatory rule added, $ruleName would have to be 'mandatory'.
The search string is is case insensitive.
<?php
// add a rule to the item object
// look for the rule
$ruleExists =
$item->hasRule('mandatory'); // would return TRUE
$ruleExists =
$item->hasRule('Mandatory'); // would return TRUE
$ruleExists =
$item->hasRule('Formagic_Rule_Mandatory'); // would return FALSE
?>
Tags:
Parameters:
method isDisabled [line 715]
Returns disabled status of item
Tags:
method isHidden [line 668]
Returns hidden status of item
Tags:
method isIgnored [line 692]
Returns ignore status of item
Tags:
method printInfo [line 204]
method setAttributes [line 345]
Sets additional attributes for this item.
Mainly used for additional HTML attributes other than "name", "id" or "value", such as "style", "class", javascript-handlers etc. Attributes are added corresponding to key->value-pairs in $attArray.
setAttributes() will overwrite any previously added item attributes.
Implements a fluent interface pattern.
Tags:
Parameters:
method setDisabled [line 704]
Sets disabled flag for item and removes it from form
Implements a fluent interface pattern.
Tags:
Overridden in child classes as:
- Formagic_Item_Container::setDisabled()
- Disables container item and all its descendants and thus removes all involved items from form.
Parameters:
method setFixed [line 731]
Sets isFixed flag.
If set to true, all following calls to setValue() will be ignored.
Implements a fluent interface pattern.
Tags:
Parameters:
method setHidden [line 657]
Sets hidden flag for item.
Implements a fluent interface pattern.
Tags:
Overridden in child classes as:
- Formagic_Item_Container::setHidden()
- Sets hidden flag on container item and all its descendants.
Parameters:
method setIgnore [line 681]
Defines if the item will be ignored in form submit.
Implements a fluent interface pattern.
Tags:
Parameters:
method setReadonly [line 643]
Sets readonly flag
Implements a fluent interface pattern.
Tags:
Overridden in child classes as:
- Formagic_Item_Container::setReadonly()
- Sets readonly flag to container item and all its descendants.
Parameters:
method setRequiredAttributes [line 324]
void setRequiredAttributes(
$requiredAttributes)
|
|
Tags:
Parameters:
method setValue [line 315]
method validate [line 586]
Performs rule checks
Iterates through all defined rules of Formagic item. Returns true if all rules apply or false otherwise.
Tags:
Overridden in child classes as:
- Formagic_Item_Container::validate()
- Validates contained items.
method _buildAttributeStr [line 455]
string _buildAttributeStr(
$attributes)
|
|
Tags:
Parameters:
method _filterValue [line 270]
void _filterValue(
$filter,
$subject)
|
|
Tags:
Parameters:
method _init [line 195]
method _makeDomId [line 743]
string _makeDomId(
string
$str)
|
|
Takes a string and returns a valid DOM ID.
Tags:
Parameters:
method _validateItemValue [line 605]
boolean _validateItemValue(
$rule, string|array
$subject)
|
|
Perform validation on item value.
Tags:
Parameters:
method __toString [line 223]
Returns the HTML string representation of the form item.
Tags: