| @@ 48-62 (lines=15) @@ | ||
| 45 | $this->twig->addFunction($filter); |
|
| 46 | } |
|
| 47 | ||
| 48 | protected function extendForGetUrl() : void |
|
| 49 | { |
|
| 50 | $filter = new Twig_SimpleFunction( |
|
| 51 | 'getUrl', |
|
| 52 | function ( |
|
| 53 | $alias, |
|
| 54 | $params = [] |
|
| 55 | ) { |
|
| 56 | $function = new Functions\GetUrl($this->config['base_url'], $this->config['aliases'], $alias, $params); |
|
| 57 | return $function->run(); |
|
| 58 | }, |
|
| 59 | array('is_safe' => array('html')) |
|
| 60 | ); |
|
| 61 | $this->twig->addFunction($filter); |
|
| 62 | } |
|
| 63 | ||
| 64 | protected function extendForWidget() : void |
|
| 65 | { |
|
| @@ 64-78 (lines=15) @@ | ||
| 61 | $this->twig->addFunction($filter); |
|
| 62 | } |
|
| 63 | ||
| 64 | protected function extendForWidget() : void |
|
| 65 | { |
|
| 66 | $filter = new \Twig_SimpleFunction( |
|
| 67 | 'Widget_*_*', |
|
| 68 | function ($widgetNameStr, $widgetActionStr, $args = []) { |
|
| 69 | $function = new Functions\Widget($this->twig, $this->config, $widgetNameStr, $widgetActionStr, $args); |
|
| 70 | return $function->run(); |
|
| 71 | }, |
|
| 72 | array('is_safe' => array('html')) |
|
| 73 | ); |
|
| 74 | $this->twig->addFunction($filter); |
|
| 75 | } |
|
| 76 | ||
| 77 | protected function extendForQueryParams() : void |
|
| 78 | { |
|
| 79 | $filter = new \Twig_SimpleFunction( |
|
| 80 | 'queryParams', |
|
| 81 | function ($queryParams, $prefix = '?') { |
|