NEW Use injector for creating SSViewer

This commit is contained in:
Robbie Averill 2017-07-13 15:45:35 +12:00 committed by Sam Minnée
parent 4700e5e159
commit 1cf8a67f21
3 changed files with 3 additions and 3 deletions

View File

@ -450,7 +450,7 @@ HTML;
SSViewer::get_templates_by_class(static::class, "", "SilverStripe\\Control\\Controller")
);
return new SSViewer($templates);
return SSViewer::create($templates);
}

View File

@ -816,7 +816,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
public function Breadcrumbs($maxDepth = 20, $unlinked = false, $stopAtPageType = false, $showHidden = false)
{
$pages = $this->getBreadcrumbItems($maxDepth, $stopAtPageType, $showHidden);
$template = new SSViewer('BreadcrumbsTemplate');
$template = SSViewer::create('BreadcrumbsTemplate');
return $template->process($this->customise(new ArrayData(array(
"Pages" => $pages,
"Unlinked" => $unlinked

View File

@ -65,7 +65,7 @@ class SiteTreeFileExtension extends DataExtension
*/
public function BackLinkHTMLList()
{
$viewer = new SSViewer(["type" => "Includes", self::class . "_description"]);
$viewer = SSViewer::create(["type" => "Includes", self::class . "_description"]);
return $viewer->process($this->owner);
}