Be.pageRenderer ViewHelper <f:be.pageRenderer>
ViewHelper to register backend module resources like CSS and JavaScript using the PageRenderer.
Examples
All options:
<f:be.pageRenderer
pageTitle="foo"
includeCssFiles="{0: 'EXT:my_ext/Resources/Public/Css/Stylesheet.css'}"
includeJsFiles="{0: 'EXT:my_ext/Resources/Public/JavaScript/Library1.js', 1: 'EXT:my_ext/Resources/Public/JavaScript/Library2.js'}"
addJsInlineLabels="{'my_ext.label1': 'LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:label1'}"
includeJavaScriptModules="{0: '@my-vendor/my-ext/my-module.js'}"
includeRequireJsModules="{0: 'EXT:my_ext/Resources/Public/JavaScript/RequireJsModule'}"
addInlineSettings="{'some.setting.key': 'some.setting.value'}"
/>
Copied!
This will load the specified css, js files and requireJs modules, adds a custom js inline setting, and adds a resolved label to be used in js.
Source code
Go to the source code of this ViewHelper: Be\PageRendererViewHelper.php (GitHub).
Arguments
The following arguments are available for the be.pageRenderer ViewHelper:
addInlineSettings
-
- Type
- array
Adds Javascript Inline Setting
addJsInlineLabels
-
- Type
- array
Custom labels to add to JavaScript inline labels
includeCssFiles
-
- Type
- array
List of custom CSS file to be loaded
includeJavaScriptModules
-
- Type
- array
List of JavaScript modules to be loaded
includeJsFiles
-
- Type
- array
List of custom JavaScript file to be loaded
includeRequireJsModules
-
- Type
- array
List of RequireJS modules to be loaded
pageTitle
-
- Type
- string
- Default
- ''
title tag of the module. Not required by default, as BE modules are shown in a frame