Hi everybody!
Here’s what I’m trying to do:
In one action, I want to output a PDF as content. The PDF gets its content from a template.
My action code:
public function printDocumentTemplateAction() { $view = new StandaloneView(); $view->setTemplatePathAndFilename("resource://XX.YY/Private/Templates/Document/Template.html"); $view->setLayoutRootPath("resource://XX.YY/Private/Layouts/"); $content = $view->render(); ... creating PDF ... }
Private/Templates/Document/Template.html:
<f:layout name="Document.html" />
Private/Layouts/Document.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link href="{f:uri.resource(path: 'CSS/documentTable.css')}" rel="stylesheet" />
</head>
<body>
</body>
</html>
You see, in the layout file, I’m trying to import a CSS file. Using this file in my Default layout (so using standard actions without setting any templates, template rooth pathes etc), it works.
However, in this case I’m getting the error:
Invalid resource URI “resource:///Public/CSS/documentTable.en.css”: Package “” is not available.
Nested Exception
Package “” is not available.
Does anyone have any idea what I’m doing wrong here? Thank you very much for your support!