本文整理汇总了PHP中TYPO3\CMS\Fluid\View\StandaloneView::render方法的典型用法代码示例。如果您正苦于以下问题:PHP StandaloneView::render方法的具体用法?PHP StandaloneView::render怎么用?PHP StandaloneView::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Fluid\View\StandaloneView
的用法示例。
在下文中一共展示了StandaloneView::render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* The main method of the PlugIn
* @param string $content : The PlugIn content
* @param array $conf : The PlugIn configuration
* @return string The content that is displayed on the website
*/
public function main($content, $conf)
{
$this->ms = GeneralUtility::milliseconds();
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
// Configuring so caching is not expected. This value means that no cHash params are ever set.
// We do this, because it's a USER_INT object!
$this->pi_USER_INT_obj = 1;
// initializes plugin configuration
$this->init();
// init template for pi1
$this->initFluidTemplate();
// hook for initials
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) {
$_procObj =& GeneralUtility::getUserObj($_classRef);
$_procObj->addInitials($this);
}
}
// get content for searchbox
$this->getSearchboxContent();
// assign variables and do the rendering
$this->searchFormView->assignMultiple($this->fluidTemplateVariables);
$htmlOutput = $this->searchFormView->render();
return $htmlOutput;
}
示例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: getExtensionSummary
/**
* Render the Plugin Info
*
* @param array $params
* @param object $pObj
* @return string
*/
public function getExtensionSummary($params, &$pObj)
{
$data = GeneralUtility::xml2array($params['row']['pi_flexform']);
$this->init($data);
$this->getSelectedObjects($data);
$this->fluidRenderer->assign($this->pluginMode, true);
$this->fluidRenderer->assign('storageFolder', $this->getStorageFolder($data));
$this->fluidRenderer->assign('gallery', $this->selectedGallery);
$this->fluidRenderer->assign('album', $this->selectedAlbum);
$this->fluidRenderer->assign('item', $this->selectedItem);
$this->fluidRenderer->assign('caLabel', 'LLL:EXT:yag/Resources/Private/Language/locallang.xlf:tx_yag_flexform_controllerAction.' . $this->pluginMode);
$this->fluidRenderer->assign('theme', $this->theme);
$this->fluidRenderer->assign('context', $this->getDataValue($data, 'settings.contextIdentifier'));
return $this->fluidRenderer->render();
}
示例4: 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);
}
示例5: 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();
}
示例6: renderingTest
/**
* @param string $viewHelperTemplate
* @param string $expectedOutput
*
* @test
* @dataProvider viewHelperTemplateSourcesDataProvider
*/
public function renderingTest($viewHelperTemplate, $expectedOutput)
{
$view = new StandaloneView();
$view->getRenderingContext()->getViewHelperResolver()->addNamespace('ft', 'TYPO3Fluid\\FluidTest\\ViewHelpers');
$view->getRenderingContext()->getTemplatePaths()->setTemplateSource($viewHelperTemplate);
$view->assign('settings', ['test' => '<strong>Bla</strong>']);
$this->assertSame($expectedOutput, $view->render());
}
示例7: main
/**
* The main method of the PlugIn
* @param string $content : The PlugIn content
* @param array $conf : The PlugIn configuration
* @return string The content that is displayed on the website
*/
public function main($content, $conf)
{
$this->ms = GeneralUtility::milliseconds();
$this->conf = $conf;
$this->pi_setPiVarDefaults();
// use pi1 locallang values, since all the frontend locallang values for
// pi1, pi2 and pi3 are set in pi1 language file
$this->pi_loadLL('EXT:ke_search/pi1/locallang.xml');
// Configuring so caching is not expected. This value means that no cHash params are ever set.
// We do this, because it's a USER_INT object!
$this->pi_USER_INT_obj = 1;
// initializes plugin configuration
$this->init();
if ($this->conf['resultPage'] != $GLOBALS['TSFE']->id) {
$content = '<div id="textmessage">' . $this->pi_getLL('error_resultPage') . '</div>';
return $this->pi_wrapInBaseClass($content);
}
// init template
$this->initFluidTemplate();
// hook for initials
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['initials'] as $_classRef) {
$_procObj =& GeneralUtility::getUserObj($_classRef);
$_procObj->addInitials($this);
}
}
// assign isEmptySearch to fluid templates
$this->fluidTemplateVariables['isEmptySearch'] = $this->isEmptySearch;
// render "no results"-message, "too short words"-message and finally the result list
$this->getSearchResults();
// number of results
$this->fluidTemplateVariables['numberofresults'] = $this->numberOfResults;
// render links for sorting, fluid template variables are filled in class tx_kesearch_lib_sorting
$this->renderOrdering();
// process query time
$queryTime = GeneralUtility::milliseconds() - $GLOBALS['TSFE']->register['ke_search_queryStartTime'];
$this->fluidTemplateVariables['queryTime'] = $queryTime;
$this->fluidTemplateVariables['queryTimeText'] = sprintf($this->pi_getLL('query_time'), $queryTime);
// render pagebrowser
if ($GLOBALS['TSFE']->id == $this->conf['resultPage']) {
if ($this->conf['pagebrowserOnTop'] || $this->conf['pagebrowserAtBottom']) {
$this->renderPagebrowser();
}
}
// hook: modifyResultList
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyResultList'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyResultList'] as $_classRef) {
$_procObj =& GeneralUtility::getUserObj($_classRef);
$_procObj->modifyResultList($this->fluidTemplateVariables, $this);
}
}
// generate HTML output
$this->resultListView->assignMultiple($this->fluidTemplateVariables);
$htmlOutput = $this->resultListView->render();
return $htmlOutput;
}
示例8: getDropDown
/**
* Render drop down
*
* @return string Drop down HTML
*/
public function getDropDown()
{
if (!$this->checkAccess()) {
return '';
}
$request = $this->standaloneView->getRequest();
$request->setControllerExtensionName('backend');
$this->standaloneView->assignMultiple(array('installToolUrl' => BackendUtility::getModuleUrl('system_extinstall'), 'messages' => $this->systemMessages, 'count' => $this->totalCount > $this->maximumCountInBadge ? $this->maximumCountInBadge . '+' : $this->totalCount, 'severityBadgeClass' => $this->severityBadgeClass, 'systemInformation' => $this->systemInformation));
return $this->standaloneView->render();
}
示例9: 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();
}
示例10: 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;
}
示例11: 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();
}
}
}
示例12: main
//.........这里部分代码省略.........
$line = array();
if ($k == 'defaultPageTSconfig') {
$line['defaultPageTSconfig'] = 1;
} else {
$pUids[] = substr($k, 4);
$row = BackendUtility::getRecordWSOL('pages', substr($k, 4));
$icon = $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL);
$editIdList = substr($k, 4);
$urlParameters = ['edit' => ['pages' => [$editIdList => 'edit']], 'columnsOnly' => 'TSconfig', 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$line['editIcon'] = BackendUtility::getModuleUrl('record_edit', $urlParameters);
$line['editTitle'] = 'editTSconfig';
$line['title'] = BackendUtility::wrapClickMenuOnIcon($icon, 'pages', $row['uid']) . ' ' . htmlspecialchars(BackendUtility::getRecordTitle('pages', $row));
}
$tsparser = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::class);
$tsparser->lineNumberOffset = 0;
$line['content'] = $tsparser->doSyntaxHighlight(trim($v) . LF);
$lines[] = $line;
}
}
if (!empty($pUids)) {
$urlParameters = ['edit' => ['pages' => [implode(',', $pUids) => 'edit']], 'columnsOnly' => 'TSconfig', 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
$editIcon = htmlspecialchars($url);
$editTitle = 'editTSconfig_all';
} else {
$editIcon = '';
$editTitle = '';
}
$this->view->assign('tsconfParts99', 1);
$this->view->assign('csh', BackendUtility::cshItem('_MOD_web_info', 'tsconfig_edit', null, '|'));
$this->view->assign('lines', $lines);
$this->view->assign('editIcon', $editIcon);
$this->view->assign('editTitle', $editTitle);
} else {
$this->view->assign('tsconfParts99', 0);
// Defined global here!
$tmpl = GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService::class);
// Do not log time-performance information
$tmpl->tt_track = 0;
$tmpl->fixedLgd = 0;
$tmpl->linkObjects = 0;
$tmpl->bType = '';
$tmpl->ext_expandAllNotes = 1;
$tmpl->ext_noPMicons = 1;
$beUser = $this->getBackendUser();
switch ($this->pObj->MOD_SETTINGS['tsconf_parts']) {
case '1':
$modTSconfig = BackendUtility::getModTSconfig($this->pObj->id, 'mod');
break;
case '1a':
$modTSconfig = $beUser->getTSConfig('mod.web_layout', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1b':
$modTSconfig = $beUser->getTSConfig('mod.web_view', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1c':
$modTSconfig = $beUser->getTSConfig('mod.web_modules', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1d':
$modTSconfig = $beUser->getTSConfig('mod.web_list', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1e':
$modTSconfig = $beUser->getTSConfig('mod.web_info', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1f':
$modTSconfig = $beUser->getTSConfig('mod.web_func', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '1g':
$modTSconfig = $beUser->getTSConfig('mod.web_ts', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '2':
$modTSconfig = $beUser->getTSConfig('RTE', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '5':
$modTSconfig = $beUser->getTSConfig('TCEFORM', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '6':
$modTSconfig = $beUser->getTSConfig('TCEMAIN', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '3':
$modTSconfig = $beUser->getTSConfig('TSFE', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
case '4':
$modTSconfig = $beUser->getTSConfig('user', BackendUtility::getPagesTSconfig($this->pObj->id));
break;
default:
$modTSconfig['properties'] = BackendUtility::getPagesTSconfig($this->pObj->id);
}
$modTSconfig = $modTSconfig['properties'];
if (!is_array($modTSconfig)) {
$modTSconfig = array();
}
$this->view->assign('csh', BackendUtility::cshItem('_MOD_web_info', 'tsconfig_hierarchy', null, '|'));
$this->view->assign('tree', $tmpl->ext_getObjTree($modTSconfig, '', '', '', '', $this->pObj->MOD_SETTINGS['tsconf_alphaSort']));
}
$this->view->assign('alphaSort', BackendUtility::getFuncCheck($this->pObj->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'], '', '', 'id="checkTsconf_alphaSort"'));
$this->view->assign('dropdownMenu', BackendUtility::getDropdownMenu($this->pObj->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']));
}
return $this->view->render();
}
示例13: renderFluidView
/**
* Render fluid standalone view
*
* @return string
*/
protected function renderFluidView()
{
return $this->view->render();
}
示例14: renderSaveWarning
/**
* Render the warning markup when the page record has not been saved yet
*
* @return string The warning markup
*/
protected function renderSaveWarning()
{
$this->view->setTemplate('SaveWarning');
return $this->view->render();
}
示例15: renderViewForMail
/**
* @return string
*/
protected function renderViewForMail()
{
$view = new StandaloneView();
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:pt_extbase/Resources/Private/Templates/Logger/ErrorEmail.html'));
$view->assign('logRecord', $this->logRecord);
$view->assign('serverInformation', $this->serverInformation);
$view->assign('userAgent', $this->userAgent);
$view->assign('requestId', $this->requestInformation->getCurrentRequestId());
return $view->render();
}