1 | <?php |
||
13 | class StringHumanizerExtension extends AbstractHumanizerExtension |
||
14 | { |
||
15 | /** |
||
16 | * {@inheritdoc} |
||
17 | */ |
||
18 | 45 | public function getFilters() |
|
19 | { |
||
20 | return [ |
||
21 | 45 | new Twig_SimpleFilter( |
|
22 | 45 | 'humanize', |
|
23 | 45 | [StringHumanizer::class, 'humanize'] |
|
24 | 15 | ), |
|
25 | 45 | new Twig_SimpleFilter( |
|
26 | 45 | 'truncate', |
|
27 | 45 | [StringHumanizer::class, 'truncate'] |
|
28 | 15 | ), |
|
29 | 45 | new Twig_SimpleFilter( |
|
30 | 45 | 'truncate_html', |
|
31 | 45 | [StringHumanizer::class, 'truncateHtml'], |
|
32 | [ |
||
33 | 15 | 'is_safe' => [ |
|
34 | 15 | 'html', |
|
35 | 30 | ], |
|
36 | ] |
||
37 | 15 | ), |
|
38 | 45 | new Twig_SimpleFilter( |
|
39 | 45 | 'remove_shortcodes', |
|
40 | 45 | [StringHumanizer::class, 'removeShortcodes'] |
|
41 | 15 | ), |
|
42 | 45 | new Twig_SimpleFilter( |
|
43 | 45 | 'remove_shortcode_tags', |
|
44 | 45 | [StringHumanizer::class, 'removeShortcodeTags'] |
|
45 | 15 | ), |
|
46 | 15 | ]; |
|
47 | } |
||
48 | |||
49 | 15 | public function getName() |
|
53 | } |
||
54 |