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


PHP StandaloneView::setTemplatePathAndFilename方法代码示例

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


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

示例1: main

 public function main()
 {
     $result = $error = $url = NULL;
     $this->view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($this->templatePath . 'Main.html'));
     if ($this->configuration->isValid()) {
         try {
             $this->checkPageId();
             $url = $this->urlService->getFullUrl($this->pageId, $this->pObj->MOD_SETTINGS);
             if (GeneralUtility::_GET('clear')) {
                 $this->pageSpeedRepository->clearByIdentifier($url);
                 $this->view->assign('cacheCleared', TRUE);
             }
             $result = $this->pageSpeedRepository->findByIdentifier($url);
         } catch (\HTTP_Request2_ConnectionException $e) {
             $error = 'error.http_request.connection';
             // todo add log
         } catch (\RuntimeException $e) {
             $error = $e->getMessage();
         }
     } else {
         $error = 'error.invalid.key';
     }
     $this->view->assignMultiple(array('lll' => 'LLL:EXT:page_speed/Resources/Private/Language/locallang.xlf:', 'menu' => $this->modifyFuncMenu(BackendUtility::getFuncMenu($this->pObj->id, 'SET[language]', $this->pObj->MOD_SETTINGS['language'], $this->pObj->MOD_MENU['language']), 'language'), 'configuration' => $this->configuration, 'result' => $result, 'url' => $url, 'error' => $error, 'pageId' => $this->pageId));
     return $this->view->render();
 }
开发者ID:thodison,项目名称:page_speed,代码行数:25,代码来源:ModFuncController.php

示例2: loadTemplateAction

 /**
  * @param string $templateName
  * @param string $appExtensionKey
  * @return string
  */
 public function loadTemplateAction($templateName, $appExtensionKey)
 {
     $appTemplatesPath = sprintf(RoutesFileGenerator::APP_TEMPLATES_FOLDER, ExtensionManagementUtility::extPath($appExtensionKey));
     $templateFilePath = $appTemplatesPath . '/' . $templateName;
     if (!file_exists($templateFilePath)) {
         return '';
     } else {
         $this->view->setTemplatePathAndFilename($templateFilePath);
         return $this->view->render();
     }
 }
开发者ID:stocked-io,项目名称:stocked,代码行数:16,代码来源:AjaxTemplateLoadingController.php

示例3: replaceCallback

 /**
  * Callback function for rendering quotes.
  *
  * @param string $matches PCRE matches.
  * @return string  The quote content.
  */
 protected function replaceCallback($matches)
 {
     $this->view->setControllerContext($this->controllerContext);
     $this->view->setTemplatePathAndFilename(File::replaceSiteRelPath($this->settings['template']));
     $tmp = $this->postRepository->findByUid((int) $matches[1]);
     if (!empty($tmp)) {
         $this->view->assign('post', $tmp);
     }
     $this->view->assign('quote', trim($matches[2]));
     return $this->view->render();
 }
开发者ID:steffmeister,项目名称:typo3-forum,代码行数:17,代码来源:QuoteParserService.php

示例4: initFluidTemplate

 /**
  * inits the standalone fluid template
  */
 public function initFluidTemplate()
 {
     $this->searchFormView = GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $this->searchFormView->setPartialRootPaths([$this->conf['partialRootPath']]);
     $this->searchFormView->setLayoutRootPaths([$this->conf['layoutRootPath']]);
     $this->searchFormView->setTemplatePathAndFilename($this->conf['templateRootPath'] . 'SearchForm.html');
     // make settings available in fluid template
     $this->searchFormView->assign('conf', $this->conf);
     $this->searchFormView->assign('extConf', $this->extConf);
     $this->searchFormView->assign('extConfPremium', $this->extConfPremium);
 }
开发者ID:teaminmedias-pluswerk,项目名称:ke_search,代码行数:14,代码来源:class.tx_kesearch_pi1.php

示例5: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     if (!$this->checkAccess()) {
         return;
     }
     $extPath = ExtensionManagementUtility::extPath('backend');
     /* @var $view StandaloneView */
     $this->standaloneView = GeneralUtility::makeInstance(StandaloneView::class);
     $this->standaloneView->setTemplatePathAndFilename($extPath . 'Resources/Private/Templates/ToolbarMenu/' . static::TOOLBAR_MENU_TEMPLATE);
     $pageRenderer = $this->getPageRenderer();
     $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/SystemInformationMenu');
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:15,代码来源:SystemInformationToolbarItem.php

示例6: main

 /**
  * Main functions, is rendering the content
  *
  * @return void
  */
 public function main()
 {
     switch ($this->MOD_SETTINGS['function']) {
         case 'search':
             $templateFilename = 'CustomSearch.html';
             $this->func_search();
             break;
         case 'records':
             $templateFilename = 'RecordStatistics.html';
             $this->func_records();
             break;
         case 'relations':
             $templateFilename = 'Relations.html';
             $this->func_relations();
             break;
         case 'refindex':
             $templateFilename = 'ReferenceIndex.html';
             $this->func_refindex();
             break;
         default:
             $templateFilename = 'IntegrityOverview.html';
             $this->func_default();
     }
     $this->view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($this->templatePath . $templateFilename));
     $this->content = $this->view->render();
     // Setting up the buttons and markers for docheader
     $docHeaderButtons = $this->getButtons();
     $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => $this->getFuncMenu(), 'CONTENT' => $this->content);
     // Build the <body> for the module
     $this->content = $this->doc->moduleBody(array(), $docHeaderButtons, $markers);
     // Renders the module page
     $this->content = $this->doc->render($this->getLanguageService()->getLL('title'), $this->content);
 }
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:38,代码来源:DatabaseIntegrityView.php

示例7: setTemplate

 /**
  * Set template
  *
  * @param array $conf With possibly set file resource
  * @return void
  * @throws \InvalidArgumentException
  */
 protected function setTemplate(array $conf)
 {
     // Fetch the Fluid template by templateName
     if (!empty($conf['templateName']) && !empty($conf['templateRootPaths.']) && is_array($conf['templateRootPaths.'])) {
         $templateRootPaths = array();
         foreach ($conf['templateRootPaths.'] as $key => $path) {
             if (strpos($key, '.') === false) {
                 $templateRootPaths[$key] = isset($conf['templateRootPaths.'][$key . '.']) ? GeneralUtility::getFileAbsFileName($this->cObj->stdWrap($conf['templateRootPaths.'][$key], $conf['templateRootPaths.'][$key . '.'])) : GeneralUtility::getFileAbsFileName($path);
             }
         }
         $this->view->setTemplateRootPaths($templateRootPaths);
         $templateName = isset($conf['templateName.']) ? $this->cObj->stdWrap($conf['templateName'], $conf['templateName.']) : $conf['templateName'];
         $this->view->setTemplate($templateName);
         // Fetch the Fluid template by template cObject
     } elseif (!empty($conf['template']) && !empty($conf['template.'])) {
         $templateSource = $this->cObj->cObjGetSingle($conf['template'], $conf['template.']);
         $this->view->setTemplateSource($templateSource);
         // Fetch the Fluid template by file stdWrap
     } else {
         $file = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
         /** @var $templateService \TYPO3\CMS\Core\TypoScript\TemplateService */
         $templateService = $GLOBALS['TSFE']->tmpl;
         $templatePathAndFilename = $templateService->getFileName($file);
         $this->view->setTemplatePathAndFilename(PATH_site . $templatePathAndFilename);
     }
 }
开发者ID:hlop,项目名称:TYPO3.CMS,代码行数:33,代码来源:FluidTemplateContentObject.php

示例8: getPartialRootPathReturnsDefaultPathIfNoPartialRootPathIsSpecified

 /**
  * @test
  */
 public function getPartialRootPathReturnsDefaultPathIfNoPartialRootPathIsSpecified()
 {
     $templatePathAndFilename = 'some/template/RootPath/SomeTemplate.html';
     $this->view->setTemplatePathAndFilename($templatePathAndFilename);
     $expectedResult = 'some/template/RootPath/Partials';
     $actualResult = $this->view->getPartialRootPath();
     $this->assertEquals($expectedResult, $actualResult);
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:11,代码来源:StandaloneViewTest.php

示例9: setTemplate

 /**
  * Set template
  *
  * @param array $conf With possibly set file resource
  * @return void
  */
 protected function setTemplate(array $conf)
 {
     // Fetch the Fluid template
     $file = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
     /** @var $templateService \TYPO3\CMS\Core\TypoScript\TemplateService */
     $templateService = $GLOBALS['TSFE']->tmpl;
     $templatePathAndFilename = $templateService->getFileName($file);
     $this->view->setTemplatePathAndFilename($templatePathAndFilename);
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:15,代码来源:FluidTemplateContentObject.php

示例10: render

 /**
  * @param StandaloneView $view
  * @param PageRenderer $pageRenderer
  * @param LoginController $loginController
  * @throws \UnexpectedValueException
  */
 public function render(StandaloneView $view, PageRenderer $pageRenderer, LoginController $loginController)
 {
     GeneralUtility::makeInstance(ObjectManager::class)->get(Dispatcher::class)->dispatch(__CLASS__, self::SIGNAL_getPageRenderer, array($pageRenderer));
     $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/UserPassLogin');
     $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/UserPassLoginForm.html'));
     if (GeneralUtility::getIndpEnv('TYPO3_SSL')) {
         $view->assign('presetUsername', GeneralUtility::_GP('u'));
         $view->assign('presetPassword', GeneralUtility::_GP('p'));
     }
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:16,代码来源:UsernamePasswordLoginProvider.php

示例11: renderContent

 /**
  * renderContent renders sie given Fluidtemplate an adds the given data to the view helper.
  * Your templates have to be in "Resources/Private/Html/Content/"
  *
  * @param array  $data Daten für das Fluid-Template
  * @param string $templateFile
  *
  * @return string Content
  */
 public function renderContent($data, $templateFile)
 {
     if (file_exists($templateFile)) {
         $this->view->getRequest()->setControllerExtensionName($this->extKey);
         $this->view->setTemplatePathAndFilename($templateFile);
         $this->view->assign('data', $data);
         $content = $this->view->render();
     } else {
         $content = 'Could not load template!';
     }
     return $content;
 }
开发者ID:Entwicklungshilfe-NRW,项目名称:wmdb_base_ewh,代码行数:21,代码来源:index.php

示例12: setTemplate

 /**
  * Set template
  *
  * @param array $conf With possibly set file resource
  * @return void
  * @throws \InvalidArgumentException
  */
 protected function setTemplate(array $conf)
 {
     // Fetch the Fluid template
     if (!empty($conf['template']) && !empty($conf['template.'])) {
         $templateSource = $this->cObj->cObjGetSingle($conf['template'], $conf['template.']);
         $this->view->setTemplateSource($templateSource);
     } else {
         $file = isset($conf['file.']) ? $this->cObj->stdWrap($conf['file'], $conf['file.']) : $conf['file'];
         /** @var $templateService \TYPO3\CMS\Core\TypoScript\TemplateService */
         $templateService = $GLOBALS['TSFE']->tmpl;
         $templatePathAndFilename = $templateService->getFileName($file);
         $this->view->setTemplatePathAndFilename(PATH_site . $templatePathAndFilename);
     }
 }
开发者ID:rob-ot-dot-be,项目名称:ggallkeysecurity,代码行数:21,代码来源:FluidTemplateContentObject.php

示例13: main

 /**
  * main method
  *
  * @return string
  */
 public function main()
 {
     $this->view = $this->objectManager->get('\\TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $this->view->getRequest()->setControllerExtensionName($this->getExtensionName());
     $this->view->getRequest()->setPluginName('UpdateScript');
     $this->view->getRequest()->setControllerName('UpdateScript');
     $this->view->setLayoutRootPaths($this->getTemplateFolders('layout'));
     $this->view->setPartialRootPaths($this->getTemplateFolders('partial'));
     $this->view->assign('requestUri', GeneralUtility::getIndpEnv('REQUEST_URI'));
     $action = GeneralUtility::_GP('action') ? GeneralUtility::_GP('action') : 'Main';
     if (is_callable(array($this, $action . 'Action'))) {
         $this->view->setTemplatePathAndFilename($this->getTemplatePath('UpdateScript/' . ucfirst($action) . '.html'));
         $content = call_user_func_array(array($this, $action . 'Action'), array());
     }
     return $content;
 }
开发者ID:kalypso63,项目名称:px_hybrid_auth,代码行数:21,代码来源:AbstractUpdateScript.php

示例14: init

 /**
  * Init some values
  * 
  * @param array $data
  */
 protected function init($data)
 {
     $templatePathAndFilename = GeneralUtility::getFileAbsFileName('EXT:yag/Resources/Private/Templates/Backend/PluginInfo.html');
     // Extbase
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $configuration['extensionName'] = self::EXTENSION_NAME;
     $configuration['pluginName'] = self::PLUGIN_NAME;
     $bootstrap = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Core\\Bootstrap');
     $bootstrap->initialize($configuration);
     // Fluid
     $this->fluidRenderer = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $this->fluidRenderer->setTemplatePathAndFilename($templatePathAndFilename);
     // PluginMode
     if (is_array($data)) {
         $firstControllerAction = array_shift(explode(';', $this->getDataValue($data, 'switchableControllerActions', 'sDefault')));
         $this->pluginMode = str_replace('->', '_', $firstControllerAction);
         // Theme
         $this->theme = $this->getDataValue($data, 'settings.theme', 'sDefault');
     }
 }
开发者ID:beyond-agentur,项目名称:yag,代码行数:25,代码来源:CMSLayoutHook.php

示例15: render

 /**
  * Add sys_notes as additional content to the footer of the page module
  *
  * @param array $params
  * @param PageLayoutController $parentObject
  * @return string
  */
 public function render(array $params = array(), PageLayoutController $parentObject)
 {
     if ($parentObject->MOD_SETTINGS['function'] == 1) {
         $pageInfo = $parentObject->pageinfo;
         if ($this->pageCanBeIndexed($pageInfo)) {
             // template
             $this->loadCss();
             $this->loadJavascript();
             //load partial paths info from typoscript
             $this->view = GeneralUtility::makeInstance(StandaloneView::class);
             $this->view->setFormat('html');
             $this->view->getRequest()->setControllerExtensionName('cs_seo');
             $absoluteResourcesPath = ExtensionManagementUtility::extPath('cs_seo') . 'Resources/';
             $layoutPaths = [$absoluteResourcesPath . 'Private/Layouts/'];
             $partialPaths = [$absoluteResourcesPath . 'Private/Partials/'];
             // load partial paths info from TypoScript
             if ($this->isTYPO3VersionGreather6) {
                 /** @var ObjectManager $objectManager */
                 $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
                 /** @var ConfigurationManagerInterface $configurationManager */
                 $configurationManager = $objectManager->get(ConfigurationManagerInterface::class);
                 $tsSetup = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'csseo');
                 $layoutPaths = $tsSetup["view"]["layoutRootPaths"] ?: $layoutPaths;
                 $partialPaths = $tsSetup["view"]["partialRootPaths"] ?: $partialPaths;
             }
             $this->view->setLayoutRootPaths($layoutPaths);
             $this->view->setPartialRootPaths($partialPaths);
             $this->view->setTemplatePathAndFilename(ExtensionManagementUtility::extPath('cs_seo') . 'Resources/Private/Templates/PageHook.html');
             $results = $this->getResults($pageInfo, $parentObject->current_sys_language);
             $score = $results['Percentage'];
             unset($results['Percentage']);
             $this->view->assignMultiple(['score' => $score, 'results' => $results, 'page' => $parentObject->pageinfo]);
             return $this->view->render();
         }
     }
 }
开发者ID:clickstorm,项目名称:cs_seo,代码行数:43,代码来源:PageHook.php


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