-
(Boolean) hasError ()
Returns true is the field has an error.
returns true if the field has some errors, false otherwise
-
__construct ($widget, $parent = null, $name, $value, $error = null)
| $widget |
A sfWidget instance |
| $parent |
The sfFormField parent instance (null for the root widget) |
| $name |
The field name |
| $value |
The field value |
| $error |
A sfValidatorError instance |
Constructor.
-
(Exception) getToStringException ()
Gets the exception if one was thrown in the __toString() method.
This is a hack needed because PHP does not allow to throw exceptions in __toString() magic method.
-
(string) render ($attributes = array())
| $attributes |
An array of HTML attributes |
Renders the form field.
returns The rendered widget
-
(string) renderRow ($attributes = array(), $label = null, $help = null)
| $attributes |
An array of HTML attributes to merge with the current attributes |
| $label |
The label name (not null to override the current value) |
| $help |
The help text (not null to override the current value) |
Returns a formatted row.
The formatted row will use the parent widget schema formatter. The formatted row contains the label, the field, the error and the help message.
returns The formatted row
-
(mixed) getValue ()
Returns the widget value.
returns The widget value
-
(string) renderLabel ($label = null, $attributes = array())
| $label |
The label name (not null to override the current value) |
| $attributes |
Optional html attributes |
Returns the label tag.
returns The label tag
-
(boolean) hasToStringException ()
Returns true if a form thrown an exception in the __toString() method
This is a hack needed because PHP does not allow to throw exceptions in __toString() magic method.
-
getError ()
Returns the error for this field.
returns A sfValidatorError instance
-
(string) renderLabelName ()
Returns the label name given a widget name.
returns The label name
-
(string) renderError ()
Returns a formatted error list.
The formatted list will use the parent widget schema formatter.
returns The formatted error list
-
getWidget ()
Returns the wrapped widget.
returns A sfWidget instance
-
(string) __toString ()
Returns the string representation of this form field.
returns The rendered field
-
getParent ()
Returns the parent form field.
returns A sfFormField instance
-
(Boolean) isHidden ()
Returns true if the widget is hidden.
returns true if the widget is hidden, false otherwise
-
setToStringException ($e)
| $e |
The exception thrown by __toString() |
Sets an exception thrown by the __toString() method.
This is a hack needed because PHP does not allow to throw exceptions in __toString() magic method.