<?php

namespace Shop;

use Twig_SimpleFunction;


/**
 * Расширение функций для твига
 *
 * @author Admin
 */
class TwigExtension extends \Twig\Extension\AbstractExtension
{

    /**
     * 
     * @return type
     */
    public function getFunctions()
    {
        return array(
            //@todo убрать
            new Twig_SimpleFunction("display_sex", function ($sex) {
                return \Shop\Helpers\Product::display_sex($sex);
            }, ['is_safe' => ['html']]),
            //@todo убрать
            new Twig_SimpleFunction("display_price", function ($prices, $currency = "", $delim = "-") {
                return \Shop\Helpers\Price::display($prices, $currency, $delim);
            }, ['is_safe' => ['html']]),
                                  
        );
    }

}