29 lines
845 B
PHP
29 lines
845 B
PHP
<?php
|
|
namespace Sasae\Extension;
|
|
|
|
use Index\ByteFormat;
|
|
use Index\Environment as NdxEnvironment;
|
|
use Sasae\SasaeEnvironment;
|
|
use Twig\TwigFilter;
|
|
use Twig\TwigFunction;
|
|
use Twig\Extension\AbstractExtension as TwigAbstractExtension;
|
|
|
|
/**
|
|
* Provides version functions and additional functionality implemented in Index.
|
|
*/
|
|
class SasaeExtension extends TwigAbstractExtension {
|
|
public function getFilters() {
|
|
return [
|
|
new TwigFilter('format_filesize', ByteFormat::format(...)),
|
|
];
|
|
}
|
|
|
|
public function getFunctions() {
|
|
return [
|
|
new TwigFunction('ndx_version', NdxEnvironment::getIndexVersion(...)),
|
|
new TwigFunction('sasae_version', SasaeEnvironment::getSasaeVersion(...)),
|
|
new TwigFunction('twig_version', SasaeEnvironment::getTwigVersion(...)),
|
|
];
|
|
}
|
|
}
|