renderForm()
Overview
public string function renderForm(
required string formName
, string mergeWithFormName = ""
, string context = "admin"
, string fieldLayout = "formcontrols.layouts.field"
, string fieldsetLayout = "formcontrols.layouts.fieldset"
, string tabLayout = "formcontrols.layouts.tab"
, string formLayout = "formcontrols.layouts.form"
, string formId = ""
, string component = ""
, any validationResult = ""
, boolean includeValidationJs = true
, string validationJsJqueryRef = "presideJQuery"
, struct savedData
, struct additionalArgs
, string fieldNamePrefix = ""
, string fieldNameSuffix = ""
, array suppressFields
, boolean stripPermissionedFields = true
, string permissionContext = ""
, array permissionContextKeys
)
Renders the given form
Arguments
Name | Type | Required | Description |
---|---|---|---|
formName | string | Yes | Name of the form to render |
mergeWithFormName | string | No (default="") | Name of a secondary form to merge with the primary form |
context | string | No (default="admin") | Context in which to render the form, e.g. 'admin' or 'website'. See Rendering Preside form definitions for more details. |
fieldLayout | string | No (default="formcontrols.layouts.field") | Viewlet for rendering a field layout. See Rendering Preside form definitions for more details. |
fieldsetLayout | string | No (default="formcontrols.layouts.fieldset") | Viewlet for rendering a fieldset layout. See Rendering Preside form definitions for more details. |
tabLayout | string | No (default="formcontrols.layouts.tab") | Viewlet for rendering a tab layout. See Rendering Preside form definitions for more details. |
formLayout | string | No (default="formcontrols.layouts.form") | Viewlet for rendering an overall form layout. See Rendering Preside form definitions for more details. |
formId | string | No (default="") | HTML ID of the wrapping form element. This is used for the js validation logic if generated. |
component | string | No (default="") | |
validationResult | any | No (default="") | An existing validation result object with which to display errors in the form (see Validation framework and Preside form validation for more details) |
includeValidationJs | boolean | No (default=true) | Whether or not to generate and include validation javascript with the form |
validationJsJqueryRef | string | No (default="presideJQuery") | |
savedData | struct | No | Structure of pre-existing data with which to pre-populate values in the form |
additionalArgs | struct | No | Structure of additional dynamic args to be passed to the renders of fields, fieldsets and tabs. See Rendering Preside form definitions for more details. |
fieldNamePrefix | string | No (default="") | A prefix to add to each field name |
fieldNameSuffix | string | No (default="") | A suffix to add to each field name |
suppressFields | array | No | An array of field names to hide from the rendering |
stripPermissionedFields | boolean | No (default=true) | |
permissionContext | string | No (default="") | |
permissionContextKeys | array | No |