AbstractFormEngineAjaxController uses FormResultTrait

AbstractYes

Abstract class for a couple of FormEngine controllers triggered by ajax calls. The class containers some helpers to for instance prepare the form render result for json output.

Internal

Marked as internal for now, methods in this class may change any time.

Table of Contents

Methods

addRegisteredRequireJsModulesToJavaScriptItems()  : void
createExecutableStringRepresentationOfRegisteredRequireJsModules()  : array<string|int, mixed>
Gets result array from FormEngine and returns string with js modules that need to be loaded and evaluated by JavaScript.
getLabelsFromLocalizationFile()  : array<string|int, mixed>
Parse a language file and get a label/value array from it.
getLanguageService()  : LanguageService|null
getRelativePathToStylesheetFile()  : string
Resolve a CSS file position, possibly prefixed with 'EXT:'
serializeJavaScriptModuleInstructionItems()  : array<string|int, mixed>

Methods

addRegisteredRequireJsModulesToJavaScriptItems()

protected addRegisteredRequireJsModulesToJavaScriptItems(array<string|int, mixed> $result, JavaScriptItems $items) : void
Parameters
$result : array<string|int, mixed>
$items : JavaScriptItems

createExecutableStringRepresentationOfRegisteredRequireJsModules()

Gets result array from FormEngine and returns string with js modules that need to be loaded and evaluated by JavaScript.

protected createExecutableStringRepresentationOfRegisteredRequireJsModules(array<string|int, mixed> $result[, bool $skipInstructions = false ]) : array<string|int, mixed>
Parameters
$result : array<string|int, mixed>
$skipInstructions : bool = false

whether to skip JavaScriptModuleInstruction

Return values
array<string|int, mixed>

getLabelsFromLocalizationFile()

Parse a language file and get a label/value array from it.

protected getLabelsFromLocalizationFile(string $file) : array<string|int, mixed>
Parameters
$file : string

EXT:path/to/file

Return values
array<string|int, mixed>

Label/value array

getRelativePathToStylesheetFile()

Resolve a CSS file position, possibly prefixed with 'EXT:'

protected getRelativePathToStylesheetFile(string $stylesheetFile) : string
Parameters
$stylesheetFile : string

Given file, possibly prefixed with EXT:

Return values
string

Web root relative position to file

serializeJavaScriptModuleInstructionItems()

protected serializeJavaScriptModuleInstructionItems(JavaScriptModuleInstruction $instruction) : array<string|int, mixed>
Parameters
$instruction : JavaScriptModuleInstruction
Tags
todo

This is a temporary "solution" and shall be handled in JavaScript directly

Return values
array<string|int, mixed>

        
On this page

Search results