From 3cd9e09d00546868b82847dcbd3c507aeba26103 Mon Sep 17 00:00:00 2001 From: Stepan Postler Date: Fri, 27 May 2022 17:16:33 +0200 Subject: [PATCH] update for late 3 --- composer.json | 2 +- src/UI/DatasetControl.php | 5 +++++ src/UI/FilterList/list.latte | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a94cfd9..5dc4ce1 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "nette/application": "^3.1", "nette/neon": "^3.0", "nette/utils": "^3.1", - "nextras/orm": ">=4.0" + "nextras/orm": "^4.0" }, "autoload": { "psr-4": { diff --git a/src/UI/DatasetControl.php b/src/UI/DatasetControl.php index f9ddf40..64ca063 100644 --- a/src/UI/DatasetControl.php +++ b/src/UI/DatasetControl.php @@ -4,6 +4,8 @@ namespace Stepapo\Dataset\UI; +use Latte\Engine; +use Latte\Essential\RawPhpExtension; use Nette\Application\UI\Template; use Nette\Localization\Translator; use Nextras\Orm\Entity\IEntity; @@ -36,6 +38,9 @@ protected function createTemplate(): Template $template->setTranslator($this->getTranslator()); $template->addFilter('intlDate', [Filters::class, 'intlDate']); $template->addFilter('plural', [Filters::class, 'plural']); + if (version_compare(Engine::VERSION, '3', '>=')) { + $template->getLatte()->addExtension(new RawPhpExtension); + } return $template; } diff --git a/src/UI/FilterList/list.latte b/src/UI/FilterList/list.latte index 5bc89c7..7033d07 100644 --- a/src/UI/FilterList/list.latte +++ b/src/UI/FilterList/list.latte @@ -3,7 +3,7 @@
{foreach $columns as $column} {if $column->filter && !$column->filter->hide} - {control filter-$column->name} + {control 'filter-' . $column->name} {/} {/}