<?php
class Core_Twig_Extensions_Extension_Router extends Twig_Extension
{
    public function getFunctions()
    {
        return array(
            'path' => new Twig_Function_Method($this, 'path'),
            'url'  => new Twig_Function_Method($this, 'url')
        );
    }

    /**
     *
     * @param array $params
     * @param string $name
     * @param boolean $reset
     *
     * @return string
     */
    public function url($params = null, $name = null, $reset = false)
    {
        return Core_Application::get('Router')->url($params, $name, $reset);
    }

    /**
     *
     * @param array $params
     * @param string $name
     * @param boolean $reset
     *
     * @return string
     */
    public function path($params = null, $name = null, $reset = false)
    {
        return Core_Application::get('Router')->path($params, $name, $reset);
    }

    public function getName()
    {
        return 'Core_Twig_Extensions_Extension_Router';
    }
}