当前位置: 首页>>代码示例>>PHP>>正文


PHP PageRenderer::setLanguage方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Page\PageRenderer::setLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer::setLanguage方法的具体用法?PHP PageRenderer::setLanguage怎么用?PHP PageRenderer::setLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Page\PageRenderer的用法示例。


在下文中一共展示了PageRenderer::setLanguage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setupPage

 /**
  * Sets mandatory parameters for the view (pageRenderer)
  *
  * @return void
  */
 protected function setupPage()
 {
     // Yes, hardcoded on purpose
     $this->pageRenderer->setXmlPrologAndDocType('<!DOCTYPE html>');
     $this->pageRenderer->setCharSet('utf-8');
     $this->pageRenderer->setLanguage('default');
     $this->pageRenderer->addMetaTag('<meta name="viewport" content="width=device-width, initial-scale=1">');
 }
开发者ID:Gregpl,项目名称:TYPO3.CMS,代码行数:13,代码来源:ModuleTemplate.php

示例2: areInlineLanguageLabelsSelectedAndStripped

 /**
  * Tests the addInlineLanguageLabelFile() method.
  *
  * @test
  */
 public function areInlineLanguageLabelsSelectedAndStripped()
 {
     $this->fixture->setLanguage($GLOBALS['LANG']->lang);
     $this->fixture->addInlineLanguageLabelFile('EXT:lang/locallang_core.xml', 'labels.', 'lock');
     $out = $this->fixture->render();
     $this->assertContains('edRecord', $out);
     $this->assertContains('edRecord_content', $out);
     $this->assertContains('edRecordUser', $out);
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:14,代码来源:PageRendererTest.php

示例3: initLLvars

 /**
  * Initializing the getLL variables needed.
  *
  * @return void
  */
 public function initLLvars()
 {
     // Init languageDependencies list
     $this->languageDependencies = array();
     // Setting language key and split index:
     $this->lang = $this->config['config']['language'] ?: 'default';
     $this->pageRenderer->setLanguage($this->lang);
     // Finding the requested language in this list based
     // on the $lang key being inputted to this function.
     /** @var $locales Locales */
     $locales = GeneralUtility::makeInstance(Locales::class);
     $locales->initialize();
     // Language is found. Configure it:
     if (in_array($this->lang, $locales->getLocales())) {
         $this->languageDependencies[] = $this->lang;
         foreach ($locales->getLocaleDependencies($this->lang) as $language) {
             $this->languageDependencies[] = $language;
         }
     }
     // Setting charsets:
     $this->renderCharset = $this->csConvObj->parse_charset($this->config['config']['renderCharset'] ? $this->config['config']['renderCharset'] : 'utf-8');
     // Rendering charset of HTML page.
     $this->metaCharset = $this->csConvObj->parse_charset($this->config['config']['metaCharset'] ? $this->config['config']['metaCharset'] : $this->renderCharset);
 }
开发者ID:Torsten85,项目名称:TYPO3.CMS,代码行数:29,代码来源:TypoScriptFrontendController.php

示例4: initPageRenderer

 /**
  * Initializes the page renderer object
  */
 protected function initPageRenderer()
 {
     if ($this->pageRenderer !== null) {
         return;
     }
     $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
     $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);
     $this->pageRenderer->enableConcatenateFiles();
     $this->pageRenderer->enableCompressCss();
     $this->pageRenderer->enableCompressJavascript();
     // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
     foreach ($this->jsFilesNoConcatenation as $file) {
         $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file, 'text/javascript', true, false, '', true);
     }
     // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
     foreach ($this->jsFiles as $file) {
         $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file);
     }
     if ((int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1) {
         $this->pageRenderer->enableDebugMode();
     }
 }
开发者ID:burguin,项目名称:test01,代码行数:25,代码来源:DocumentTemplate.php

示例5: getPageRenderer

 /**
  * Gets instance of PageRenderer configured with the current language, file references and debug settings
  *
  * @return \TYPO3\CMS\Core\Page\PageRenderer
  */
 public function getPageRenderer()
 {
     if (!isset($this->pageRenderer)) {
         $this->pageRenderer = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Page\\PageRenderer');
         $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);
         $this->pageRenderer->addCssLibrary($GLOBALS['BACK_PATH'] . 'contrib/normalize/normalize.css', 'stylesheet', 'all', '', TRUE, TRUE);
         $this->pageRenderer->enableConcatenateFiles();
         $this->pageRenderer->enableCompressCss();
         $this->pageRenderer->enableCompressJavascript();
         // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
         foreach ($this->jsFilesNoConcatenation as $file) {
             $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file, 'text/javascript', TRUE, FALSE, '', TRUE);
         }
         // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
         foreach ($this->jsFiles as $file) {
             $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file);
         }
     }
     if ((int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1) {
         $this->pageRenderer->enableDebugMode();
     }
     return $this->pageRenderer;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:28,代码来源:DocumentTemplate.php

示例6: getPageRenderer

 /**
  * Gets instance of PageRenderer configured with the current language, file references and debug settings
  *
  * @return \TYPO3\CMS\Core\Page\PageRenderer
  */
 public function getPageRenderer()
 {
     if (!isset($this->pageRenderer)) {
         $this->pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Page\\PageRenderer');
         $this->pageRenderer->setTemplateFile(TYPO3_mainDir . 'templates/template_page_backend.html');
         $this->pageRenderer->setLanguage($GLOBALS['LANG']->lang);
         $this->pageRenderer->enableConcatenateFiles();
         $this->pageRenderer->enableCompressCss();
         $this->pageRenderer->enableCompressJavascript();
         // Add all JavaScript files defined in $this->jsFiles to the PageRenderer
         foreach ($this->jsFiles as $file) {
             $this->pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . $file);
         }
     }
     if (intval($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) === 1) {
         $this->pageRenderer->enableDebugMode();
     }
     return $this->pageRenderer;
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:24,代码来源:DocumentTemplate.php


注:本文中的TYPO3\CMS\Core\Page\PageRenderer::setLanguage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。