5
5
use Sg\DatatablesBundle\Datatable\AbstractDatatable;
6
6
7
7
<?php foreach ($ column_types as $ type ): ?>
8
- use Sg\DatatablesBundle\Datatable\Column\<?= $ type ?> ;
8
+ use Sg\DatatablesBundle\Datatable\Column\<?= $ type ?> ;
9
9
<?php endforeach ; ?>
10
10
11
11
/**
12
- * Class <?= $ class_name .PHP_EOL ?>
13
- *
14
- * @package <?= $ namespace ?> \Datatables
15
- */
12
+ * Class <?= $ class_name .PHP_EOL ?>
13
+ *
14
+ * @package <?= $ namespace ?> \Datatables
15
+ */
16
16
class <?= $ class_name ?> extends AbstractDatatable
17
17
{
18
18
19
- /**
20
- * {@inheritdoc}
21
- *
22
- * @throws \Exception
23
- */
24
- public function buildDatatable(array $options = array())
25
- {
26
- $this->language->set(array(
27
- 'cdn_language_by_locale' => true
28
- //'language' => 'de'
29
- ));
19
+ /**
20
+ * {@inheritdoc}
21
+ *
22
+ * @throws \Exception
23
+ */
24
+ public function buildDatatable(array $options = array())
25
+ {
26
+ $this->language->set(array(
27
+ 'cdn_language_by_locale' => true
28
+ //'language' => 'de'
29
+ ));
30
30
31
- $this->ajax->set(array(
32
- ));
31
+ $this->ajax->set(array(
32
+ ));
33
33
34
- $this->options->set(array(
35
- 'individual_filtering' => true,
36
- 'individual_filtering_position' => 'head',
37
- 'order_cells_top' => true,
38
- ));
34
+ $this->options->set(array(
35
+ 'individual_filtering' => true,
36
+ 'individual_filtering_position' => 'head',
37
+ 'order_cells_top' => true,
38
+ ));
39
39
40
- $this->features->set(array(
41
- ));
40
+ $this->features->set(array(
41
+ ));
42
42
43
- $this->columnBuilder
44
- <?php foreach ($ fields as $ field ): ?>
45
- ->add('<?= $ field ['property ' ] ?> ', <?= $ field ['column_type ' ] ?> , array(
46
- 'title' => '<?= $ field ['title ' ] ?> ',
43
+ $this->columnBuilder
44
+ <?php foreach ($ fields as $ field ): ?>
45
+ ->add('<?= $ field ['property ' ] ?> ', <?= $ field ['column_type ' ] ?> , array(
46
+ 'title' => '<?= $ field ['title ' ] ?> ',
47
47
<?php if (isset ($ field ['data ' ]) && $ field ['data ' ]!== null ): ?>
48
- 'data' => '<?= $ field ['data ' ] ?> '
48
+ 'data' => '<?= $ field ['data ' ] ?> '
49
49
<?php endif ?>
50
- ))
51
- <?php endforeach ; ?>
52
- ->add(null, ActionColumn::class, array(
53
- 'title' => $this->translator->trans('sg.datatables.actions.title'),
54
- 'actions' => array(
55
- array(
56
- 'route' => '<?= $ route_pref ?> _show',
57
- 'route_parameters' => array(
58
- 'id' => 'id'
59
- ),
60
- 'label' => $this->translator->trans('sg.datatables.actions.show'),
61
- 'icon' => 'glyphicon glyphicon-eye-open',
62
- 'attributes' => array(
63
- 'rel' => 'tooltip',
64
- 'title' => $this->translator->trans('sg.datatables.actions.show'),
65
- 'class' => 'btn btn-primary btn-xs',
66
- 'role' => 'button'
67
- ),
68
- ),
69
- array(
70
- 'route' => '<?= $ route_pref ?> _edit',
71
- 'route_parameters' => array(
72
- 'id' => 'id'
73
- ),
74
- 'label' => $this->translator->trans('sg.datatables.actions.edit'),
75
- 'icon' => 'glyphicon glyphicon-edit',
76
- 'attributes' => array(
77
- 'rel' => 'tooltip',
78
- 'title' => $this->translator->trans('sg.datatables.actions.edit'),
79
- 'class' => 'btn btn-primary btn-xs',
80
- 'role' => 'button'
81
- ),
82
- )
83
- )
84
- ));
85
- }
50
+ ))
51
+ <?php endforeach ; ?>
52
+ ->add(null, ActionColumn::class, array(
53
+ 'title' => $this->translator->trans('sg.datatables.actions.title'),
54
+ 'actions' => array(
55
+ array(
56
+ 'route' => '<?= $ route_pref ?> _show',
57
+ 'route_parameters' => array(
58
+ 'id' => 'id'
59
+ ),
60
+ 'label' => $this->translator->trans('sg.datatables.actions.show'),
61
+ 'icon' => 'glyphicon glyphicon-eye-open',
62
+ 'attributes' => array(
63
+ 'rel' => 'tooltip',
64
+ 'title' => $this->translator->trans('sg.datatables.actions.show'),
65
+ 'class' => 'btn btn-primary btn-xs',
66
+ 'role' => 'button'
67
+ ),
68
+ ),
69
+ array(
70
+ 'route' => '<?= $ route_pref ?> _edit',
71
+ 'route_parameters' => array(
72
+ 'id' => 'id'
73
+ ),
74
+ 'label' => $this->translator->trans('sg.datatables.actions.edit'),
75
+ 'icon' => 'glyphicon glyphicon-edit',
76
+ 'attributes' => array(
77
+ 'rel' => 'tooltip',
78
+ 'title' => $this->translator->trans('sg.datatables.actions.edit'),
79
+ 'class' => 'btn btn-primary btn-xs',
80
+ 'role' => 'button'
81
+ ),
82
+ )
83
+ )
84
+ ));
85
+ }
86
86
87
- /**
88
- * {@inheritdoc}
89
- */
90
- public function getEntity()
91
- {
92
- return '<?= $ bounded_full_class_name ?> ';
93
- }
87
+ /**
88
+ * {@inheritdoc}
89
+ */
90
+ public function getEntity()
91
+ {
92
+ return '<?= $ bounded_full_class_name ?> ';
93
+ }
94
94
95
- /**
96
- * {@inheritdoc}
97
- */
98
- public function getName()
99
- {
100
- return '<?= $ datatable_name ?> ';
101
- }
95
+ /**
96
+ * {@inheritdoc}
97
+ */
98
+ public function getName()
99
+ {
100
+ return '<?= $ datatable_name ?> ';
101
+ }
102
102
}
0 commit comments