2014-12-12 17:47:27 +03:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* This file is part of Handlebars.php Helpers Set
|
|
|
|
*
|
|
|
|
* (c) Dmitriy Simushev <simushevds@gmail.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace JustBlackBird\HandlebarsHelpers;
|
|
|
|
|
|
|
|
use Handlebars\Helpers as BaseHelpers;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Contains all helpers.
|
|
|
|
*
|
|
|
|
* @author Dmitriy Simushev <simushevds@gmail.com>
|
|
|
|
*/
|
|
|
|
class Helpers extends BaseHelpers
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function addDefaultHelpers()
|
|
|
|
{
|
|
|
|
parent::addDefaultHelpers();
|
|
|
|
|
|
|
|
// Date helpers
|
|
|
|
$this->add('formatDate', new Date\FormatDateHelper());
|
|
|
|
|
|
|
|
// Comparison helpers
|
2014-12-15 13:52:46 +03:00
|
|
|
$this->add('ifAny', new Comparison\IfAnyHelper());
|
2014-12-12 17:47:27 +03:00
|
|
|
$this->add('ifEqual', new Comparison\IfEqualHelper());
|
|
|
|
$this->add('ifEven', new Comparison\IfEvenHelper());
|
|
|
|
$this->add('ifOdd', new Comparison\IfOddHelper());
|
|
|
|
$this->add('unlessEqual', new Comparison\UnlessEqualHelper());
|
2014-12-15 12:38:49 +03:00
|
|
|
|
|
|
|
// String helpers
|
|
|
|
$this->add('lowercase', new String\LowercaseHelper());
|
2014-12-15 12:50:18 +03:00
|
|
|
$this->add('uppercase', new String\UppercaseHelper());
|
2014-12-15 13:19:04 +03:00
|
|
|
$this->add('repeat', new String\RepeatHelper());
|
2014-12-15 15:27:30 +03:00
|
|
|
$this->add('truncate', new String\TruncateHelper());
|
2014-12-12 17:47:27 +03:00
|
|
|
}
|
|
|
|
}
|