Initial commit: apps.supersam24.ru
This commit is contained in:
commit
e955e1da36
6566 files changed
+1271095
No files matched your search
@@ -0,0 +1,43 @@
|
||||
<?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 Time
|
||||
* @package WyriHaximus\TwigView\Lib\Twig\Extension
|
||||
*/
|
||||
class Time extends \Twig_Extension
|
||||
{
|
||||
/**
|
||||
* Get declared functions.
|
||||
*
|
||||
* @return \Twig_SimpleFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new \Twig_SimpleFunction('time', function ($time = null, $timezone = null) {
|
||||
return new \Cake\I18n\Time($time, $timezone);
|
||||
}),
|
||||
new \Twig_SimpleFunction('timezones', 'Cake\I18n\Time::listTimezones'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get extension name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'time';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user