本文整理汇总了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();
}
示例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();
}
}
示例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();
}
示例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);
}
示例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');
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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'));
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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');
}
}
示例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();
}
}
}