renderWith Namespace for Template Loading

Just calling MyCustomTemplate does not work in SS 4.2.X. Adding the full Namespace as a path is now required.
This commit is contained in:
Aled Brown 2018-11-21 15:28:12 +00:00 committed by GitHub
parent cc712892a9
commit ff1a0dd6fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ use SilverStripe\View\SSViewer;
public function RenderCustomTemplate()
{
SSViewer::setRewriteHashLinks(false);
$html = $this->renderWith('MyCustomTemplate');
$html = $this->renderWith('My/Namespace/MyCustomTemplate');
SSViewer::setRewriteHashLinks(true);
return $html;