<?php

namespace Shop\Presentation;

use Twig\TwigFunction;
use Twig_SimpleFunction;


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

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

}