/** * Set different format if given in configuration * * @param array $conf Configuration array * @return void */ protected function setFormat(array $conf) { $format = isset($conf['format.']) ? $this->cObj->stdWrap($conf['format'], $conf['format.']) : $conf['format']; if ($format) { $this->view->setFormat($format); } }
/** * 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(); } } }
/** * @test */ public function setFormatSetsRequestFormat() { $this->mockRequest->expects($this->once())->method('setFormat')->with('xml'); $this->view->setFormat('xml'); }