本文整理匯總了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);
}
}
}