class UserDefinedFormController extends PageController (View source)

Controller for the UserDefinedForm page type.

Properties

Methods

protected
init()

No description

protected
addUserFormsValidatei18n()

Add the necessary jQuery validate i18n translation files, either by locale or by langauge, e.g. 'en_NZ' or 'en'. This adds "methods_abc.min.js" as well as "messages_abc.min.js" from the jQuery validate thirdparty library from dist/js.

public
array
index(HTTPRequest $request = null)

Using $UserDefinedForm in the Content area of the page shows where the form should be rendered into. If it does not exist then default back to $Form.

public
int
ping()

Keep the session alive for the user.

public
Form()

Get the form for the page. Form can be modified by calling updateForm() on a UserDefinedForm extension.

public
void
generateConditionalJavascript()

Generate the javascript for the conditional field show / hiding logic.

public
int
getMaximumAllowedEmailAttachmentSize()

Returns the maximum size uploaded files can be before they're excluded from CMS configured recipient emails

protected
int
parseByteSizeString(string $byteSize)

Convert file sizes with a single character for unit size to true byte count.

public
process(array $data, Form $form)

Process the form that is submitted through the site

protected
getMergeFieldsMap(ArrayList $fields = [])

Allows the use of field values in email body.

public
finished()

This action handles rendering the "finished" message, which is customizable by editing the ReceivedFormSubmission template.

protected
string
buildWatchJS(array $watch)

Outputs the required JS from the $watch input

Details

protected init()

No description

protected addUserFormsValidatei18n()

Add the necessary jQuery validate i18n translation files, either by locale or by langauge, e.g. 'en_NZ' or 'en'. This adds "methods_abc.min.js" as well as "messages_abc.min.js" from the jQuery validate thirdparty library from dist/js.

array index(HTTPRequest $request = null)

Using $UserDefinedForm in the Content area of the page shows where the form should be rendered into. If it does not exist then default back to $Form.

Parameters

HTTPRequest $request

Return Value

array

int ping()

Keep the session alive for the user.

Return Value

int

Form Form()

Get the form for the page. Form can be modified by calling updateForm() on a UserDefinedForm extension.

Return Value

Form

void generateConditionalJavascript()

Generate the javascript for the conditional field show / hiding logic.

Return Value

void

int getMaximumAllowedEmailAttachmentSize()

Returns the maximum size uploaded files can be before they're excluded from CMS configured recipient emails

Return Value

int

size in megabytes

protected int parseByteSizeString(string $byteSize)

Convert file sizes with a single character for unit size to true byte count.

Just as with php.ini and e.g. 128M -> 1024 1024 128 bytes.

Parameters

string $byteSize

Return Value

int bytes

See also

https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes

HTTPResponse process(array $data, Form $form)

Process the form that is submitted through the site

{\SilverStripe\UserForms\Form\UserForm::validate()} for validation step prior to processing

Parameters

array $data
Form $form

Return Value

HTTPResponse

protected ArrayData getMergeFieldsMap(ArrayList $fields = [])

Allows the use of field values in email body.

Parameters

ArrayList $fields

Return Value

ArrayData

ViewableData finished()

This action handles rendering the "finished" message, which is customizable by editing the ReceivedFormSubmission template.

Return Value

ViewableData

protected string buildWatchJS(array $watch)

Outputs the required JS from the $watch input

Parameters

array $watch

Return Value

string