1 | <?php |
||
27 | class ButtonTwigExtension extends AbstractButtonTwigExtension { |
||
28 | |||
29 | /** |
||
30 | * Service name. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | const SERVICE_NAME = "wbw.bootstrap.twig.extension.css.button"; |
||
35 | |||
36 | /** |
||
37 | * Displays a Bootstrap button "danger". |
||
38 | * |
||
39 | * @param array $args The arguments. |
||
40 | * @return string Returns the Bootstrap button "danger". |
||
41 | */ |
||
42 | public function bootstrapButtonDangerFunction(array $args = []) { |
||
43 | return $this->bootstrapButton(ButtonFactory::parseDangerButton($args), ArrayHelper::get($args, "icon")); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Displays a Bootstrap button "dark". |
||
48 | * |
||
49 | * @param array $args The arguments. |
||
50 | * @return string Returns the Bootstrap button "dark". |
||
51 | */ |
||
52 | public function bootstrapButtonDarkFunction(array $args = []) { |
||
53 | return $this->bootstrapButton(ButtonFactory::parseDarkButton($args), ArrayHelper::get($args, "icon")); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Displays a Bootstrap button "default". |
||
58 | * |
||
59 | * @param array $args The arguments. |
||
60 | * @return string Returns the Bootstrap button "default". |
||
61 | */ |
||
62 | public function bootstrapButtonDefaultFunction(array $args = []) { |
||
65 | |||
66 | /** |
||
67 | * Displays a Bootstrap button "info". |
||
68 | * |
||
69 | * @param array $args The arguments. |
||
70 | * @return string Returns the Bootstrap button "info". |
||
71 | */ |
||
72 | public function bootstrapButtonInfoFunction(array $args = []) { |
||
75 | |||
76 | /** |
||
77 | * Displays a Bootstrap button "light". |
||
78 | * |
||
79 | * @param array $args The arguments. |
||
80 | * @return string Returns the Bootstrap button "light". |
||
81 | */ |
||
82 | public function bootstrapButtonLightFunction(array $args = []) { |
||
85 | |||
86 | /** |
||
87 | * Transforms a Bootstrap button into an anchor. |
||
88 | * |
||
89 | * @param string $button The button. |
||
90 | * @param string $href The href attribute. |
||
91 | * @param string $target The target attribute. |
||
92 | * @return string Returns the Bootstrap button transformed into an anchor. |
||
93 | */ |
||
94 | public function bootstrapButtonLinkFilter($button, $href = self::DEFAULT_HREF, $target = null) { |
||
109 | |||
110 | /** |
||
111 | * Displays a Bootstrap button "link". |
||
112 | * |
||
113 | * @param array $args The arguments. |
||
114 | * @return string Returns the Bootstrap button "link". |
||
115 | */ |
||
116 | public function bootstrapButtonLinkFunction(array $args = []) { |
||
119 | |||
120 | /** |
||
121 | * Displays a Bootstrap button "primary". |
||
122 | * |
||
123 | * @param array $args The arguments. |
||
124 | * @return string Returns the Bootstrap button "primary". |
||
125 | */ |
||
126 | public function bootstrapButtonPrimaryFunction(array $args = []) { |
||
129 | |||
130 | /** |
||
131 | * Displays a Bootstrap button "secondary". |
||
132 | * |
||
133 | * @param array $args The arguments. |
||
134 | * @return string Returns the Bootstrap button "secondary". |
||
135 | */ |
||
136 | public function bootstrapButtonSecondaryFunction(array $args = []) { |
||
139 | |||
140 | /** |
||
141 | * Transforms a Bootstrap button into a submit button. |
||
142 | * |
||
143 | * @param string $button The button. |
||
144 | * @return string Returns the Bootstrap button transformed into a submit button. |
||
145 | */ |
||
146 | public function bootstrapButtonSubmitFilter($button) { |
||
149 | |||
150 | /** |
||
151 | * Displays a Bootstrap button "success". |
||
152 | * |
||
153 | * @param array $args The arguments. |
||
154 | * @return string Returns the Bootstrap button "success". |
||
155 | */ |
||
156 | public function bootstrapButtonSuccessFunction(array $args = []) { |
||
159 | |||
160 | /** |
||
161 | * Displays a Bootstrap button "warning". |
||
162 | * |
||
163 | * @param array $args The arguments. |
||
164 | * @return string Returns the Bootstrap button "warning". |
||
165 | */ |
||
166 | public function bootstrapButtonWarningFunction(array $args = []) { |
||
169 | |||
170 | /** |
||
171 | * Get the Twig filters. |
||
172 | * |
||
173 | * @return TwigFilter[] Returns the Twig filters. |
||
174 | */ |
||
175 | public function getFilters() { |
||
184 | |||
185 | /** |
||
186 | * Get the Twig functions. |
||
187 | * |
||
188 | * @return TwigFunction[] Returns the Twig functions. |
||
189 | */ |
||
190 | public function getFunctions() { |
||
201 | |||
202 | /** |
||
203 | * Get the Twig functions. |
||
204 | * |
||
205 | * @return TwigFunction[] Returns the Twig functions. |
||
206 | */ |
||
207 | protected function getFunctions3() { |
||
241 | |||
242 | /** |
||
243 | * Get the Twig functions. |
||
244 | * |
||
245 | * @return TwigFunction[] Returns the Twig functions. |
||
246 | */ |
||
247 | protected function getFunctions4() { |
||
259 | } |
||
260 |