1 | <?php |
||
24 | class DataTablesTwigExtension extends AbstractDataTablesTwigExtension { |
||
25 | |||
26 | /** |
||
27 | * Service name. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | const SERVICE_NAME = "webeweb.datatablesbundle.twig.extension.datatables"; |
||
32 | |||
33 | /** |
||
34 | * Constructor. |
||
35 | */ |
||
36 | public function __construct() { |
||
37 | parent::__construct(); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Get the Twig functions. |
||
42 | * |
||
43 | * @return array Returns the Twig functions. |
||
44 | */ |
||
45 | public function getFunctions() { |
||
46 | return [ |
||
47 | new Twig_SimpleFunction("jQueryDataTables", [$this, "jQueryDataTablesFunction"], ["is_safe" => ["html"]]), |
||
48 | new Twig_SimpleFunction("jQueryDataTablesStandalone", [$this, "jQueryDataTablesStandaloneFunction"], ["is_safe" => ["html"]]), |
||
49 | new Twig_SimpleFunction("renderDataTables", [$this, "renderDataTablesFunction"], ["is_safe" => ["html"]]), |
||
50 | ]; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Displays a jQuery DataTables. |
||
55 | * |
||
56 | * @param DataTablesWrapper $dtWrapper The wrapper. |
||
57 | * @param array $args The arguments. |
||
58 | * @return string Returns the jQuery DataTables. |
||
59 | */ |
||
60 | public function jQueryDataTablesFunction(DataTablesWrapper $dtWrapper, array $args = []) { |
||
63 | |||
64 | /** |
||
65 | * Displays a jQuery DataTables "Standalone". |
||
66 | * |
||
67 | * @param array $args The arguments. |
||
68 | * @return string Returns the jQuery DataTables "Standalone". |
||
69 | */ |
||
70 | public function jQueryDataTablesStandaloneFunction(array $args = []) { |
||
73 | |||
74 | /** |
||
75 | * Render a DataTables. |
||
76 | * |
||
77 | * @param DataTablesWrapper $dtWrapper The wrapper. |
||
78 | * @param array $args The arguments. |
||
79 | * @return string Returns the rendered DataTables. |
||
80 | */ |
||
81 | public function renderDataTablesFunction(DataTablesWrapper $dtWrapper, array $args = []) { |
||
84 | |||
85 | } |
||
86 |