1 | <?php |
||
29 | final class TwigGridRenderer implements GridRendererInterface |
||
30 | { |
||
31 | /** |
||
32 | * @var \Twig_Environment |
||
33 | */ |
||
34 | private $twig; |
||
35 | |||
36 | /** |
||
37 | * @var ServiceRegistryInterface |
||
38 | */ |
||
39 | private $fieldsRegistry; |
||
40 | |||
41 | /** |
||
42 | * @var FormFactoryInterface |
||
43 | */ |
||
44 | private $formFactory; |
||
45 | |||
46 | /** |
||
47 | * @var FormTypeRegistryInterface |
||
48 | */ |
||
49 | private $formTypeRegistry; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | private $defaultTemplate; |
||
55 | |||
56 | /** |
||
57 | * @var array |
||
58 | */ |
||
59 | private $actionTemplates; |
||
60 | |||
61 | /** |
||
62 | * @var array |
||
63 | */ |
||
64 | private $filterTemplates; |
||
65 | |||
66 | /** |
||
67 | * @param \Twig_Environment $twig |
||
68 | * @param ServiceRegistryInterface $fieldsRegistry |
||
69 | * @param FormFactoryInterface $formFactory |
||
70 | * @param FormTypeRegistryInterface $formTypeRegistry |
||
71 | * @param string $defaultTemplate |
||
72 | * @param array $actionTemplates |
||
73 | * @param array $filterTemplates |
||
74 | */ |
||
75 | public function __construct( |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function render(GridViewInterface $gridView, $template = null) |
||
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | public function renderField(GridViewInterface $gridView, Field $field, $data) |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function renderAction(GridViewInterface $gridView, Action $action, $data = null) |
||
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | public function renderFilter(GridViewInterface $gridView, Filter $filter) |
||
159 | |||
160 | /** |
||
161 | * @param Filter $filter |
||
162 | * |
||
163 | * @return string |
||
164 | * |
||
165 | * @throws \InvalidArgumentException |
||
166 | */ |
||
167 | private function getFilterTemplate(Filter $filter) |
||
181 | } |
||
182 |