本文整理汇总了PHP中TYPO3\CMS\Fluid\View\StandaloneView::assignMultiple方法的典型用法代码示例。如果您正苦于以下问题:PHP StandaloneView::assignMultiple方法的具体用法?PHP StandaloneView::assignMultiple怎么用?PHP StandaloneView::assignMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Fluid\View\StandaloneView
的用法示例。
在下文中一共展示了StandaloneView::assignMultiple方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
}
示例3: 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;
}
示例4: 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();
}
示例5: render
/**
* Rendering the cObject, FLUIDTEMPLATE
*
* Configuration properties:
* - file string+stdWrap The FLUID template file
* - layoutRootPaths array of filepath+stdWrap Root paths to layouts (fallback)
* - partialRootPaths array of filepath+stdWrap Root paths to partials (fallback)
* - variable array of cObjects, the keys are the variable names in fluid
* - dataProcessing array of data processors which are classes to manipulate $data
* - extbase.pluginName
* - extbase.controllerExtensionName
* - extbase.controllerName
* - extbase.controllerActionName
*
* Example:
* 10 = FLUIDTEMPLATE
* 10.templateName = MyTemplate
* 10.templateRootPaths.10 = EXT:site_configuration/Resources/Private/Templates/
* 10.partialRootPaths.10 = EXT:site_configuration/Resources/Private/Patials/
* 10.layoutRootPaths.10 = EXT:site_configuration/Resources/Private/Layouts/
* 10.variables {
* mylabel = TEXT
* mylabel.value = Label from TypoScript coming
* }
*
* @param array $conf Array of TypoScript properties
* @return string The HTML output
*/
public function render($conf = array())
{
$parentView = $this->view;
$this->initializeStandaloneViewInstance();
if (!is_array($conf)) {
$conf = array();
}
$this->setFormat($conf);
$this->setTemplate($conf);
$this->setLayoutRootPath($conf);
$this->setPartialRootPath($conf);
$this->setExtbaseVariables($conf);
$this->assignSettings($conf);
$variables = $this->getContentObjectVariables($conf);
$variables = $this->processData($conf, $variables);
$this->view->assignMultiple($variables);
$content = $this->renderFluidView();
$content = $this->applyStandardWrapToRenderedContent($content, $conf);
$this->view = $parentView;
return $content;
}
示例6: 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();
}
}
}
示例7: main
/**
* Main function - creating the login/logout form
*
* @throws Exception
* @return string The content to output
*/
public function main()
{
/** @var $pageRenderer PageRenderer */
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Login');
// support placeholders for IE9 and lower
$clientInfo = GeneralUtility::clientInfo();
if ($clientInfo['BROWSER'] === 'msie' && $clientInfo['VERSION'] <= 9) {
$pageRenderer->addJsLibrary('placeholders', 'sysext/core/Resources/Public/JavaScript/Contrib/placeholders.jquery.min.js');
}
// Checking, if we should make a redirect.
// Might set JavaScript in the header to close window.
$this->checkRedirect();
// Extension Configuration
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']);
// Background Image
if (!empty($extConf['loginBackgroundImage'])) {
$backgroundImage = $this->getUriForFileName($extConf['loginBackgroundImage']);
$this->getDocumentTemplate()->inDocStylesArray[] = '
@media (min-width: 768px){
.typo3-login-carousel-control.right,
.typo3-login-carousel-control.left,
.panel-login { border: 0; }
.typo3-login { background-image: url("' . $backgroundImage . '"); }
}
';
}
// Add additional css to use the highlight color in the login screen
if (!empty($extConf['loginHighlightColor'])) {
$this->getDocumentTemplate()->inDocStylesArray[] = '
.btn-login.disabled, .btn-login[disabled], fieldset[disabled] .btn-login,
.btn-login.disabled:hover, .btn-login[disabled]:hover, fieldset[disabled] .btn-login:hover,
.btn-login.disabled:focus, .btn-login[disabled]:focus, fieldset[disabled] .btn-login:focus,
.btn-login.disabled.focus, .btn-login[disabled].focus, fieldset[disabled] .btn-login.focus,
.btn-login.disabled:active, .btn-login[disabled]:active, fieldset[disabled] .btn-login:active,
.btn-login.disabled.active, .btn-login[disabled].active, fieldset[disabled] .btn-login.active,
.btn-login:hover, .btn-login:focus, .btn-login:active,
.btn-login:active:hover, .btn-login:active:focus,
.btn-login { background-color: ' . $extConf['loginHighlightColor'] . '; }
.panel-login .panel-body { border-color: ' . $extConf['loginHighlightColor'] . '; }
';
}
// Logo
if (!empty($extConf['loginLogo'])) {
$logo = $extConf['loginLogo'];
} elseif (!empty($GLOBALS['TBE_STYLES']['logo_login'])) {
// Fallback to old TBE_STYLES login logo
$logo = $GLOBALS['TBE_STYLES']['logo_login'];
GeneralUtility::deprecationLog('$GLOBALS["TBE_STYLES"]["logo_login"] is deprecated since TYPO3 CMS 7 and will be removed in TYPO3 CMS 8, please use the backend extension\'s configuration instead.');
} else {
// Use TYPO3 logo depending on highlight color
if (!empty($extConf['loginHighlightColor'])) {
$logo = 'EXT:backend/Resources/Public/Images/typo3_black.svg';
} else {
$logo = 'EXT:backend/Resources/Public/Images/typo3_orange.svg';
}
$this->getDocumentTemplate()->inDocStylesArray[] = '
.typo3-login-logo .typo3-login-image { max-width: 150px; }
';
}
$logo = $this->getUriForFileName($logo);
// Start form
$formType = empty($this->getBackendUserAuthentication()->user['uid']) ? 'LoginForm' : 'LogoutForm';
$this->view->assignMultiple(array('backendUser' => $this->getBackendUserAuthentication()->user, 'hasLoginError' => $this->isLoginInProgress(), 'formType' => $formType, 'logo' => $logo, 'images' => array('capslock' => $this->getUriForFileName('EXT:backend/Resources/Public/Images/icon_capslock.svg'), 'typo3' => $this->getUriForFileName('EXT:backend/Resources/Public/Images/typo3_orange.svg')), 'copyright' => BackendUtility::TYPO3_copyRightNotice(), 'loginNewsItems' => $this->getSystemNews(), 'loginProviderIdentifier' => $this->loginProviderIdentifier, 'loginProviders' => $this->loginProviders));
// Initialize interface selectors:
$this->makeInterfaceSelectorBox();
/** @var LoginProviderInterface $loginProvider */
$loginProvider = GeneralUtility::makeInstance($this->loginProviders[$this->loginProviderIdentifier]['provider']);
$loginProvider->render($this->view, $pageRenderer, $this);
$content = $this->getDocumentTemplate()->startPage('TYPO3 CMS Login: ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']);
$content .= $this->view->render();
$content .= $this->getDocumentTemplate()->endPage();
return $content;
}