本文整理汇总了PHP中TYPO3\CMS\Fluid\View\StandaloneView::setLayoutRootPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP StandaloneView::setLayoutRootPaths方法的具体用法?PHP StandaloneView::setLayoutRootPaths怎么用?PHP StandaloneView::setLayoutRootPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Fluid\View\StandaloneView
的用法示例。
在下文中一共展示了StandaloneView::setLayoutRootPaths方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: getLayoutPathAndFilenameWalksStringKeysInReversedOrder
/**
* @test
*/
public function getLayoutPathAndFilenameWalksStringKeysInReversedOrder()
{
$this->view->setLayoutRootPaths(array('default' => 'some/Default/Directory', 'specific' => 'specific/Layout', 'verySpecific' => 'evenMore/Specific/Layout'));
$this->mockRequest->expects($this->any())->method('getFormat')->will($this->returnValue('html'));
$this->view->expects($this->at(0))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Layout/Default.html')->will($this->returnValue(false));
$this->view->expects($this->at(1))->method('testFileExistence')->with(PATH_site . 'evenMore/Specific/Layout/Default')->will($this->returnValue(false));
$this->view->expects($this->at(2))->method('testFileExistence')->with(PATH_site . 'specific/Layout/Default.html')->will($this->returnValue(false));
$this->view->expects($this->at(3))->method('testFileExistence')->with(PATH_site . 'specific/Layout/Default')->will($this->returnValue(false));
$this->view->expects($this->at(4))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default.html')->will($this->returnValue(false));
$this->view->expects($this->at(5))->method('testFileExistence')->with(PATH_site . 'some/Default/Directory/Default')->will($this->returnValue(true));
$this->assertEquals(PATH_site . 'some/Default/Directory/Default', $this->view->_call('getLayoutPathAndFilename'));
}
示例3: 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;
}
示例4: setLayoutRootPath
/**
* Set layout root path if given in configuration
*
* @param array $conf Configuration array
* @return void
*/
protected function setLayoutRootPath(array $conf)
{
// Override the default layout path via typoscript
$layoutPaths = array();
if (isset($conf['layoutRootPath']) || isset($conf['layoutRootPath.'])) {
$layoutRootPath = isset($conf['layoutRootPath.']) ? $this->cObj->stdWrap($conf['layoutRootPath'], $conf['layoutRootPath.']) : $conf['layoutRootPath'];
$layoutPaths[] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($layoutRootPath);
}
if (isset($conf['layoutRootPaths.'])) {
foreach ($conf['layoutRootPaths.'] as $key => $path) {
$layoutPaths[$key] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($path);
}
}
if (!empty($layoutPaths)) {
$this->view->setLayoutRootPaths($layoutPaths);
}
}
示例5: 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();
}
}
}
示例6: __construct
/**
* Class constructor
* Sets up view and property objects
*
* @throws InvalidTemplateResourceException In case a template is invalid
*/
public function __construct()
{
$this->view = GeneralUtility::makeInstance(StandaloneView::class);
$this->view->setPartialRootPaths($this->partialRootPaths);
$this->view->setTemplateRootPaths($this->templateRootPaths);
$this->view->setLayoutRootPaths($this->layoutRootPaths);
$this->view->setTemplate($this->templateFile);
$this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
}
示例7: __construct
/**
* Constructor
*/
public function __construct()
{
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
$this->presetRepository = GeneralUtility::makeInstance(PresetRepository::class);
$templatePath = ExtensionManagementUtility::extPath('impexp') . 'Resources/Private/';
/* @var $view StandaloneView */
$this->standaloneView = GeneralUtility::makeInstance(StandaloneView::class);
$this->standaloneView->setTemplateRootPaths([$templatePath . 'Templates/ImportExport/']);
$this->standaloneView->setLayoutRootPaths([$templatePath . 'Layouts/']);
$this->standaloneView->setPartialRootPaths([$templatePath . 'Partials/']);
$this->standaloneView->getRequest()->setControllerExtensionName('impexp');
}