FormFactory Class
This handles the processing and message reporting for all the site forms. Located in the namespace Canteen\Forms.
Item Index
Methods
getData
-
The
Get data associated with a form
Parameters:
-
The
Stringname of the parameter to get
Returns:
The value of the data
getFeedback
()
String
Return the feedback (errors and successes) as a list
Returns:
The html string with errors in a UL list
parse
-
content
-
substitutions
Convenience method for parsing content
Parameters:
-
content
StringThe string to parse
-
substitutions
DictionaryThe dictionary of tags to replace
Returns:
The parsed string
process
-
formClass
-
[async=false]
Process any forms
Parameters:
Returns:
If the request is async, the result object
service
-
alias
Get a service by alias
Parameters:
-
alias
StringThe alias
Returns:
The service matching the alias
setData
-
name
-
value
Set data associated with a form, can be retrieved when rendering the page using the getData method
Parameters:
-
name
StringThe name of the variable to set
-
value
MixedThe value of the data
startup
-
forms
Allow only certain forms to be run before site loads
Parameters:
-
forms
String multipleCollection of forms that can run before anything else
success
-
message
Report a success message
Parameters:
-
message
StringThe message to report success
Properties
parser
Parser
The parser is responsible for rendering templates
profiler
Profiler
The instance of the profiler for debugging performance