1 | <?php |
||
12 | class Routing extends \Twig_Extension |
||
13 | { |
||
14 | /** |
||
15 | * @var RouterInterface |
||
16 | */ |
||
17 | protected $router; |
||
18 | |||
19 | /** |
||
20 | * @var SlugifyInterface |
||
21 | */ |
||
22 | protected $slugify; |
||
23 | |||
24 | public function __construct(RouterInterface $router, SlugifyInterface $slugify) |
||
25 | { |
||
26 | $this->router = $router; |
||
27 | $this->slugify = $slugify; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function getFunctions() |
||
34 | { |
||
35 | return array( |
||
36 | new \Twig_SimpleFunction('ui_resource_route', array($this, 'generateObjectUrl')), |
||
|
|||
37 | new \Twig_SimpleFunction('ui_route', array($this, 'generateObjectUrl')), |
||
38 | ); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @param mixed $object |
||
43 | * @param string $routeName #Route |
||
44 | * @param string $separator |
||
45 | * @param array $query |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function generateObjectUrl($object, $routeName, $separator = '_', array $query = array()) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function getName() |
||
77 | } |
||
78 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.