2022-02-11 17:14:14 +01:00

37 lines
893 B
PHP

<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\DocStoreBundle\Templating;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
class WopiEditTwigExtension extends AbstractExtension
{
public function getFilters(): array
{
return [
new TwigFilter('chill_document_edit_button', [WopiEditTwigExtensionRuntime::class, 'renderEditButton'], [
'needs_environment' => true,
'is_safe' => ['html'],
]),
];
}
public function getFunctions(): array
{
return [
new TwigFunction('chill_document_is_editable', [WopiEditTwigExtensionRuntime::class, 'isEditable']),
];
}
}