94 $configurationManager = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
95 if ($contentObject === NULL) {
99 $configurationManager->setContentObject($contentObject);
100 $this->templateParser = $this->objectManager->get(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser');
101 $this->
setRenderingContext($this->objectManager->get(
'TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext'));
103 $request = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
107 $uriBuilder = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
108 $uriBuilder->setRequest($request);
110 $controllerContext = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext');
114 $this->templateCompiler = $this->objectManager->get(
'TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler');
116 $this->templateCompiler->setTemplateCache(
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache(
'fluid_template'));
146 return $this->controllerContext->getRequest();
226 if ($this->layoutRootPaths === NULL && $this->templatePathAndFilename === NULL) {
229 if ($this->layoutRootPaths === NULL) {
230 $this->layoutRootPaths = array(dirname($this->templatePathAndFilename) .
'/Layouts');
281 if ($this->partialRootPaths === NULL && $this->templatePathAndFilename === NULL) {
284 if ($this->partialRootPaths === NULL) {
285 $this->partialRootPaths = array(dirname($this->templatePathAndFilename) .
'/Partials');
314 if ($this->templateSource === NULL) {
317 $templateFilenameWithoutExtension = basename(
$templatePathAndFilename,
'.' . $templatePathAndFilenameInfo[
'extension']);
318 $prefix = sprintf(
'template_file_%s', $templateFilenameWithoutExtension);
322 $prefix =
'template_source';
323 $templateIdentifier = sprintf(
'Standalone_%s_%s', $prefix, sha1(
$templateSource));
324 return $templateIdentifier;
336 if ($this->templateSource === NULL && $this->templatePathAndFilename === NULL) {
339 if ($this->templateSource === NULL) {
340 if (!is_file($this->templatePathAndFilename)) {
343 $this->templateSource = file_get_contents($this->templatePathAndFilename);
358 $prefix =
'layout_' . $layoutName;
372 $layoutSource = file_get_contents($layoutPathAndFilename);
373 if ($layoutSource === FALSE) {
376 return $layoutSource;
392 $upperCasedLayoutName = ucfirst($layoutName);
393 $possibleLayoutPaths = array();
395 $paths = array_reverse($paths, TRUE);
399 if ($upperCasedLayoutName !== $layoutName) {
404 foreach ($possibleLayoutPaths as $layoutPathAndFilename) {
406 return $layoutPathAndFilename;
410 throw new InvalidTemplateResourceException(
'Could not load layout file. Tried following paths: "' . implode(
'", "', $possibleLayoutPaths) .
'".', 1288092555);
420 return is_file($filePath);
433 $prefix =
'partial_' . $partialName;
447 $partialSource = file_get_contents($partialPathAndFilename);
448 if ($partialSource === FALSE) {
451 return $partialSource;
462 $upperCasedPartialName = ucfirst($partialName);
464 $paths = array_reverse($paths, TRUE);
465 $possiblePartialPaths = array();
469 if ($upperCasedPartialName !== $partialName) {
474 foreach ($possiblePartialPaths as $partialPathAndFilename) {
476 return $partialPathAndFilename;
479 throw new InvalidTemplateResourceException(
'Could not load partial file. Tried following paths: "' . implode(
'", "', $possiblePartialPaths) .
'".', 1288092556);
492 $templateModifiedTimestamp = filemtime($pathAndFilename);
493 $templateIdentifier = sprintf(
'Standalone_%s_%s', $prefix, sha1($pathAndFilename .
'|' . $templateModifiedTimestamp));
494 $templateIdentifier = str_replace(
'/',
'_', str_replace(
'.',
'_', $templateIdentifier));
495 return $templateIdentifier;
setPartialRootPaths(array $partialRootPaths)
getTemplatePathAndFilename()
getTemplateIdentifier($actionName=NULL)
setTemplatePathAndFilename($templatePathAndFilename)
setPartialRootPath($partialRootPath)
getPartialIdentifier($partialName)
static getIndpEnv($getEnvName)
createIdentifierForFile($pathAndFilename, $prefix)
setRenderingContext(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
static makeInstance($className)
getLayoutSource($layoutName='Default')
setLayoutRootPaths(array $layoutRootPaths)
getLayoutIdentifier($layoutName='Default')
getTemplateSource($actionName=NULL)
getPartialPathAndFilename($partialName)
static fixWindowsFilePath($theFile)
getPartialSource($partialName)
setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
getLayoutPathAndFilename($layoutName='Default')
static sortArrayWithIntegerKeys($array)
setTemplateSource($templateSource)
testFileExistence($filePath)
setLayoutRootPath($layoutRootPath)