Initial commit: apps.supersam24.ru
This commit is contained in:
commit
e955e1da36
6566 files changed
+1271095
No files matched your search
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of TwigView.
|
||||
*
|
||||
** (c) 2014 Cees-Jan Kiewiet
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace WyriHaximus\TwigView\Lib\Twig\Extension;
|
||||
|
||||
/**
|
||||
* Class Utils
|
||||
* @package WyriHaximus\TwigView\Lib\Twig\Extension
|
||||
*/
|
||||
class Utils extends \Twig_Extension
|
||||
{
|
||||
|
||||
/**
|
||||
* Get declared filters.
|
||||
*
|
||||
* @return \Twig_SimpleFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new \Twig_SimpleFilter('serialize', 'serialize'),
|
||||
new \Twig_SimpleFilter('unserialize', 'unserialize'),
|
||||
new \Twig_SimpleFilter('md5', 'md5'),
|
||||
new \Twig_SimpleFilter('base64_encode', 'base64_encode'),
|
||||
new \Twig_SimpleFilter('base64_decode', 'base64_decode'),
|
||||
new \Twig_SimpleFilter('nl2br', 'nl2br'),
|
||||
new \Twig_SimpleFilter('string', function ($str) {
|
||||
return (string)$str;
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get extension name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'utils';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user