本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::addInlineLanguageLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::addInlineLanguageLabel方法的具体用法?PHP PageRenderer::addInlineLanguageLabel怎么用?PHP PageRenderer::addInlineLanguageLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Page\PageRenderer
的用法示例。
在下文中一共展示了PageRenderer::addInlineLanguageLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddInlineLanguageLabel
/**
* test inline language label
*/
public function testAddInlineLanguageLabel()
{
$expectedReturnValue = 'TYPO3.lang = {"myKey":"myValue"}';
$this->fixture->loadExtJS();
$this->fixture->addInlineLanguageLabel('myKey', 'myValue');
$this->fixture->enableMoveJsFromHeaderToFooter();
$out = $this->fixture->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_FOOTER);
$this->assertContains($expectedReturnValue, $out);
}
示例2: render
/**
* Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate and pageTitle
*
* @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
* @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
* @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
* @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
* @param bool $loadJQuery whether to load jQuery library. Defaults to FALSE
* @param array $includeCssFiles List of custom CSS file to be loaded
* @param array $includeJsFiles List of custom JavaScript file to be loaded
* @param array $addJsInlineLabels Custom labels to add to JavaScript inline labels
* @param array $includeRequireJsModules List of RequireJS modules to be loaded
* @param string $jQueryNamespace Store the jQuery object in a specific namespace
* @return void
*/
public function render($pageTitle = '', $loadExtJs = false, $loadExtJsTheme = true, $enableExtJsDebug = false, $loadJQuery = false, $includeCssFiles = null, $includeJsFiles = null, $addJsInlineLabels = null, $includeRequireJsModules = null, $jQueryNamespace = null)
{
if ($pageTitle) {
$this->pageRenderer->setTitle($pageTitle);
}
if ($loadExtJs) {
$this->pageRenderer->loadExtJS(true, $loadExtJsTheme);
if ($enableExtJsDebug) {
$this->pageRenderer->enableExtJsDebug();
}
}
if ($loadJQuery) {
$jQueryNamespace = $jQueryNamespace ?: PageRenderer::JQUERY_NAMESPACE_DEFAULT;
$this->pageRenderer->loadJquery(null, null, $jQueryNamespace);
}
// Include custom CSS and JS files
if (is_array($includeCssFiles) && count($includeCssFiles) > 0) {
foreach ($includeCssFiles as $addCssFile) {
$this->pageRenderer->addCssFile($addCssFile);
}
}
if (is_array($includeJsFiles) && count($includeJsFiles) > 0) {
foreach ($includeJsFiles as $addJsFile) {
$this->pageRenderer->addJsFile($addJsFile);
}
}
if (is_array($includeRequireJsModules) && count($includeRequireJsModules) > 0) {
foreach ($includeRequireJsModules as $addRequireJsFile) {
$this->pageRenderer->loadRequireJsModule($addRequireJsFile);
}
}
// Add inline language labels
if (is_array($addJsInlineLabels) && count($addJsInlineLabels) > 0) {
$extensionKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
foreach ($addJsInlineLabels as $key) {
$label = LocalizationUtility::translate($key, $extensionKey);
$this->pageRenderer->addInlineLanguageLabel($key, $label);
}
}
}