本文整理汇总了PHP中TYPO3\CMS\Core\TypoScript\TemplateService::start方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateService::start方法的具体用法?PHP TemplateService::start怎么用?PHP TemplateService::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\TypoScript\TemplateService
的用法示例。
在下文中一共展示了TemplateService::start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfigArray
/**
* Checks if config-array exists already but if not, gets it
*
* @return void
* @todo Define visibility
*/
public function getConfigArray()
{
$setStatPageName = FALSE;
// If config is not set by the cache (which would be a major mistake somewhere) OR if INTincScripts-include-scripts have been registered, then we must parse the template in order to get it
if (!is_array($this->config) || is_array($this->config['INTincScript']) || $this->forceTemplateParsing) {
$GLOBALS['TT']->push('Parse template', '');
// Force parsing, if set?:
$this->tmpl->forceTemplateParsing = $this->forceTemplateParsing;
// Start parsing the TS template. Might return cached version.
$this->tmpl->start($this->rootLine);
$GLOBALS['TT']->pull();
if ($this->tmpl->loaded) {
$GLOBALS['TT']->push('Setting the config-array', '');
// toplevel - objArrayName
$this->sPre = $this->tmpl->setup['types.'][$this->type];
$this->pSetup = $this->tmpl->setup[$this->sPre . '.'];
if (!is_array($this->pSetup)) {
$message = 'The page is not configured! [type=' . $this->type . '][' . $this->sPre . '].';
if ($this->checkPageUnavailableHandler()) {
$this->pageUnavailableAndExit($message);
} else {
$explanation = 'This means that there is no TypoScript object of type PAGE with typeNum=' . $this->type . ' configured.';
\TYPO3\CMS\Core\Utility\GeneralUtility::sysLog($message, 'cms', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message . ' ' . $explanation, 1294587217);
}
} else {
$this->config['config'] = array();
// Filling the config-array, first with the main "config." part
if (is_array($this->tmpl->setup['config.'])) {
$this->config['config'] = $this->tmpl->setup['config.'];
}
// override it with the page/type-specific "config."
if (is_array($this->pSetup['config.'])) {
$this->config['config'] = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($this->config['config'], $this->pSetup['config.']);
}
if ($this->config['config']['typolinkEnableLinksAcrossDomains']) {
$this->config['config']['typolinkCheckRootline'] = TRUE;
}
// Set default values for removeDefaultJS and inlineStyle2TempFile so CSS and JS are externalized if compatversion is higher than 4.0
if (\TYPO3\CMS\Core\Utility\GeneralUtility::compat_version('4.0')) {
if (!isset($this->config['config']['removeDefaultJS'])) {
$this->config['config']['removeDefaultJS'] = 'external';
}
if (!isset($this->config['config']['inlineStyle2TempFile'])) {
$this->config['config']['inlineStyle2TempFile'] = 1;
}
}
if (!isset($this->config['config']['compressJs'])) {
$this->config['config']['compressJs'] = 0;
}
// Processing for the config_array:
$this->config['rootLine'] = $this->tmpl->rootLine;
$this->config['mainScript'] = trim($this->config['config']['mainScript']) ? trim($this->config['config']['mainScript']) : 'index.php';
// Class for render Header and Footer parts
$template = '';
if ($this->pSetup['pageHeaderFooterTemplateFile']) {
$file = $this->tmpl->getFileName($this->pSetup['pageHeaderFooterTemplateFile']);
if ($file) {
$this->setTemplateFile($file);
}
}
}
$GLOBALS['TT']->pull();
} else {
if ($this->checkPageUnavailableHandler()) {
$this->pageUnavailableAndExit('No TypoScript template found!');
} else {
$message = 'No TypoScript template found!';
\TYPO3\CMS\Core\Utility\GeneralUtility::sysLog($message, 'cms', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message, 1294587218);
}
}
}
// Initialize charset settings etc.
$this->initLLvars();
// No cache
// Set $this->no_cache TRUE if the config.no_cache value is set!
if ($this->config['config']['no_cache']) {
$this->set_no_cache();
}
// Merge GET with defaultGetVars
if (!empty($this->config['config']['defaultGetVars.'])) {
$modifiedGetVars = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule(\TYPO3\CMS\Core\Utility\GeneralUtility::removeDotsFromTS($this->config['config']['defaultGetVars.']), \TYPO3\CMS\Core\Utility\GeneralUtility::_GET());
\TYPO3\CMS\Core\Utility\GeneralUtility::_GETset($modifiedGetVars);
}
// Hook for postProcessing the configuration array
if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'])) {
$params = array('config' => &$this->config['config']);
foreach ($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
}