當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。