static method get [line 191]
Factory method for HtmlForms, returns new instance.
Factories are used to make instant chaining possible.
Tags:
Parameters:
method addCell [line 872]
Adds a new cell to the form.
Tags:
method addCssClasses [line 794]
HtmlForm addCssClasses(
String
$cssClasses)
|
|
Adds one or many css-classes to the forms class-attribute.
This is simple string concatenation. You don't have to leave a blank at the start of the string to add.
Tags:
Parameters:
method addElement [line 811]
HtmlForm addElement(
$element, [uint
$cell = 1])
|
|
Adds an element to the form.
You can never add directly to the form, but will automatically add to a cell, which a form always has a minimum of one of. Before adding elements to additional cells, be sure to add or define them beforehand.
Tags:
Parameters:
method doRender [line 1100]
Compiles the whole form for output and returns the finished html-code-fragment.
Insert the result of this function into your page to use the form.
Tags:
method getElementByName [line 625]
FormElement/Array[FormElement] getElementByName(
String
$name, [Boolean
$multiple = false])
|
|
Returns any form element added to the form by searching for it's name.
This search is strictly for names not ids. If an element needs to be searchable just give it a name by using FormElement::setName() if it doesn't get one by default.
Tags:
Parameters:
method getId [line 561]
Returns the set html-id of the form.
Tags:
method getLanguage [line 609]
Returns the set language of the form.
Tags:
method getMethod [line 574]
String/Array[String] getMethod(
[Boolean
$returnAsArray = false])
|
|
Returns the set form method.
Also able to return the method as php-array, for direct use.
Tags:
Parameters:
method getPackagePath [line 550]
Returns the set package path.
Tags:
method getTabIndex [line 598]
Returns the set tabindex for the form.
Tags:
method getValueSet [line 671]
Returns the complete valueset of a form.
A valueset gathers all contained values of a form in one consistent object, that can be much more easily parsed than dealing with every input-characteristic manually. Missing values are null, everything else is a string or array of strings.
Tags:
Parameters:
method hasBeenSent [line 745]
Answers if the form has already been sent or not.
This is a relative information since the method searches for fitting GET- or POST-information. If you changed the action or created data under the name of the form-id you may interrupt this mechanism.
Tags:
method incTabIndex [line 859]
Increases the internal tabindex-counter of the form by one.
Should not be called externally. This is mostly a helper method for the form widgets.
Tags:
method insertElementAfter [line 830]
HtmlForm insertElementAfter(
String
$targetElementName,
$element)
|
|
Adds an element directly after another one in the form.
The target element is identified by name alone. Terminates after the first insert.
Tags:
Parameters:
method isValid [line 693]
Answers if the form is currently in a valid state.
This value is always based on the currently active validators of the form widgets. If no validators exist, the form ist always valid.
Tags:
method javascriptValidationIsSuppressed [line 759]
Boolean javascriptValidationIsSuppressed(
)
|
|
Answers if the form actively suppresses possibly set JS-validation in it.
Tags:
method prepareJavascriptValidation [line 506]
Tells the form to prepare everything concerning Javascript to use the jQuery-based Javascript-validation for form elements with activated JS-validation.
At least one form per page should do this, to be able to use JS-validation. You can leave this out for additional forms, but leaving it won't hurt dramatically either.
The method includes an own version of jQuery, which is protected by an own namespace and a JS-environment, docked to a HTMLFORM global-JS-variable.
Tags:
method printFloatBreak [line 914]
String printFloatBreak(
)
|
|
Returns the html-code used by widgets to mark the end of a supposed row in a form.
This fragment is meant to break any occured floating in the row, to prevent displaying several logical rows in the same optical row. Simply spoken: This brutally ends a row.
For internal use by form-widgets.
Tags:
method printSlash [line 899]
Returns a the character to attach to the xhtml-presentation of tags.
Should not be called externally. For internal use by the form-widgets.
Tags:
method setAction [line 263]
Set the html-action of the form.
Normally an empty string to enable form-submit-cycling.
Tags:
Parameters:
method setCells [line 394]
Sets the amount of cells to create for the form. Each cell represents a logical container for parts of the form.
This can serve the purpose of applying different styles to each cell for example, or to group widgets for easier javascript-manipulation.
This method doesn't recreate all cells but expands or contracts existing ones.
Tags:
Parameters:
method setCharsetLatin [line 315]
Tells the form to explicitly use standard english encoding, without any exotic special characters.
By setting this you also disable binary-safe string operations for all values.
Tags:
method setCharsetUtf8 [line 302]
Tells the form to handle all data and values of the form as utf-8-encoded.
This is the default setting, which should only be changed for the right reasons. Encoding does not only change the charset-attribute but changes the whole way the form handles data in encoding critical operations.
Tags:
method setCssClasses [line 362]
HtmlForm setCssClasses(
String
$cssClasses)
|
|
Sets the html-class-attribute for the form as a whole.
Use exactly the same notation you would use in html.
Tags:
Parameters:
method setEnctype [line 333]
Sets the encoding type for the form. All standard values are allowed here, other values will be ignored.
Look up the specifications if you are unsure what the usual values might be.
This setting is normally necessary for enabling file-uploads by setting this to "multipart/form-data", to allow mixed normal fields and upload fields.
Tags:
Parameters:
method setExplanation [line 434]
HtmlForm setExplanation(
unknown_type
$explanation)
|
|
Sets an explanation text for the form, which in put in a fitting container on top of the form, below the headline (if one is defined).
This is a convenience method, which also allows easier adaptation of the html-view for different forms, that can be displayed at the same spot.
Tags:
Parameters:
method setHeadline [line 418]
Sets a headline for the form, which is put in a fitting container on top of the form.
This is a convenience method, which also allows easier adaptation of the html-view for different forms, that can be displayed at the same spot.
Tags:
Parameters:
method setLanguage [line 235]
Sets the language to use in error messages. Form uses corresponding dictionary in "./messages".
Add new ones to enable other values aside from "english" and "german"
Tags:
Parameters:
method setMethodGet [line 287]
Tells the form to send all data as GET and sets the html-method-attribute.
Tags:
method setMethodPost [line 275]
Tells the form to send all data as POST and sets the html-method-attribute.
Tags:
method setMultipartFormData [line 348]
Set the encoding to the most common setting, which is multipart/form-data. This setting is needed if you include file inputs in your form, otherwise the files will not be transferred to the server.
Tags:
method setPackagePath [line 208]
HtmlForm setPackagePath(
String
$packagePath)
|
|
Sets the path to HtmlForm-package relative to the executing php-file to make usage of package assets such as javascripts and images possible (needed for special widgets such as datetime picker)
Tags:
Parameters:
method setTabIndex [line 377]
Sets the tabindex of the form itself. All widgets of the form will get tabindices according to this value.
By setting this value you can ensure a correct flow ob tabindices even if the form doesn't provide the first input on the page.
Tags:
Parameters:
method setXhtml [line 221]
Sets xhtml-rendering-mode for the form. Form renders as html4 per default.
Tags:
method showCustomMessages [line 470]
HtmlForm showCustomMessages(
[String
$title = ''], [Boolean
$show = true])
|
|
Defines if custom error messages should be displayed above the form or not.
Custom error messages are defined by the developer by defining error messages specifically for certain validators, or by setting the standard messages of a certain widget to be treated as custom. If these messages are activated you will get a selective and individual error output, which has to be defined manually.
Tags:
Parameters:
method showMessages [line 450]
HtmlForm showMessages(
[String
$title = ''], [Boolean
$show = true])
|
|
Defines if standard error messages should be displayed above the form or not.
Standard error messages are taken out of the "./messages"-dictionaries and give detailed information about failed validators on form widgets. If these messages are activated, you will get a very verbose error ouptut.
Tags:
Parameters:
method suppressJavascriptValidation [line 519]
HtmlForm suppressJavascriptValidation(
)
|
|
Deactivates the execution of all JS-validation, no matter if any elements have this activated, or the form was told to prepare for it. No JS-environment will be printed and no validation code for elements will be printed.
Tags:
method suppressJqueryInclude [line 535]
Suppresses the inclusion of HtmlForm's own jQuery version and thereby sets the forms to rely on an already included, compatible, external version. HtmlForm relies on $ being present in that case.
Use this method to prevent double includes for more or less identical jQuery-versions, which may already be part of the site.
Tags:
method useExternalFormDeclaration [line 249]
Tells the form to use an external form declaration (first around the rendered code) and not to render an own.
Useful if the form needs to be integrated into a bigger one or if special setting in the form tag are needed, which cannot be provided by the existing methods.
Tags:
method useReducedErrorMarking [line 487]
Sets the error marking in the form to reduced highlighting.
Normally the whole widget would be marked, including label, container and everything. The reduced mode only marks the inputs themselves, leaving the surroundings out. This ist especially useful if your form is rather compact and you don't want to mark half the form area for every error.
Tags:
method usesExternalFormDeclaration [line 718]
Boolean usesExternalFormDeclaration(
)
|
|
Answers if the form is currently set to use an external form declaration instead of an own one.
Tags:
method usesReducedErrorMarking [line 731]
Boolean usesReducedErrorMarking(
)
|
|
Answers if the form is currently set to only use reduced error marking for occuring validation errors.
Tags:
method usesUtf8 [line 705]
Answers if the form is currently using utf-8 for value encoding.
Tags:
method validate [line 773]
Starts the form-validation for every contained widget and calculates the validity for every value leading to the overall validity for the form as a whole.
Tags: