Inject current template name in templates

Use either legacy key _PAGE_ or new 'template' one.

Related to https://github.com/kalvn/Shaarli-Material/issues/118
This commit is contained in:
ArthurHoaro 2021-01-19 10:34:11 +01:00
parent 544bbdaf83
commit ccd1862d5f
2 changed files with 7 additions and 0 deletions
application/front/controller/visitor

View file

@ -56,6 +56,10 @@ abstract class ShaarliVisitorController
protected function render(string $template): string
{
// Legacy key that used to be injected by PluginManager
$this->assignView('_PAGE_', $template);
$this->assignView('template', $template);
$this->assignView('linkcount', $this->container->bookmarkService->count(BookmarkFilter::$ALL));
$this->assignView('privateLinkcount', $this->container->bookmarkService->count(BookmarkFilter::$PRIVATE));