Feature #58087
closed
Fluid should support "EXT:" paths
Added by Markus Hölzle over 10 years ago.
Updated about 6 years ago.
Description
In extbase controllers you can set a template path:
$this->view->setTemplatePathAndFilename(...);
This should support paths like "EXT:extension_key/Private/Templates/List.html"
In the current version this throws an InvalidTemplateResourceException in TYPO3\CMS\Fluid\View\TemplateView Line 338:
334 protected function getTemplateSource($actionName = NULL) {
335 $templatePathAndFilename = $this->getTemplatePathAndFilename($actionName);
336 $templateSource = file_get_contents($templatePathAndFilename);
337 if ($templateSource === FALSE) {
338 throw new Exception\InvalidTemplateResourceException('"' . $templatePathAndFilename . '" is not a valid template resource URI.', 1257246929);
339 }
340 return $templateSource;
341 }
- Status changed from New to Under Review
Can you give a use case where it's not possible to get the correct path when calling setTemplatePathAndFilename() ?
You could either call extension management utility to get the path to an extension or use the suggested getFileAbsFileName() to get it parsed automagically.
setTemplatePathAndFilename() says it expects an absolute path to the file.
Ok, I think it's always possible to call the getAbsFileName() manually. I just thought it would be a little simpler for developers because it would be more consistent to call always paths like "EXT:".
In my example I can set the template path for some actions via typoscript extension settings.
- Project changed from 2559 to TYPO3 Core
- Category changed from Fluid: View to Fluid
- Complexity set to easy
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/29614
Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34812
Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34812
Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34812
Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34812
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF