|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the adminbsb-material-design-bundle package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) 2018 WEBEWEB |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace WBW\Bundle\AdminBSBBundle\Twig\Extension\Typography; |
|
13
|
|
|
|
|
14
|
|
|
use Twig_SimpleFunction; |
|
15
|
|
|
use WBW\Library\Core\Argument\ArrayHelper; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Typography Twig extension. |
|
19
|
|
|
* |
|
20
|
|
|
* @author webeweb <https://github.com/webeweb/> |
|
21
|
|
|
* @package WBW\Bundle\AdminBSBBundle\Twig\Extension\Typography |
|
22
|
|
|
*/ |
|
23
|
|
|
class TypographyTwigExtension extends AbstractTypographyTwigExtension { |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Service name. |
|
27
|
|
|
* |
|
28
|
|
|
* @var string |
|
29
|
|
|
*/ |
|
30
|
|
|
const SERVICE_NAME = "webeweb.adminbsb.twig.extension.typography"; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Displays an AdminBSB bold text. |
|
34
|
|
|
* |
|
35
|
|
|
* @param array $args The arguments. |
|
36
|
|
|
* @return string Returns the AdminBSB bold text. |
|
37
|
|
|
*/ |
|
38
|
|
|
public function adminBSBBoldFunction(array $args = []) { |
|
39
|
|
|
return $this->adminBSBBold(ArrayHelper::get($args, "content")); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Displays an AdminBSB italic text. |
|
44
|
|
|
* |
|
45
|
|
|
* @param array $args The arguments. |
|
46
|
|
|
* @return string Returns the AdminBSB italic text. |
|
47
|
|
|
*/ |
|
48
|
|
|
public function adminBSBItalicFunction(array $args = []) { |
|
49
|
|
|
return $this->adminBSBItalic(ArrayHelper::get($args, "content")); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Displays an AdminBSB line through text. |
|
54
|
|
|
* |
|
55
|
|
|
* @param array $args The arguments. |
|
56
|
|
|
* @return string Returns the AdminBSB line through text. |
|
57
|
|
|
*/ |
|
58
|
|
|
public function adminBSBLineThroughFunction(array $args = []) { |
|
59
|
|
|
return $this->adminBSBLineThrough(ArrayHelper::get($args, "content")); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* Displays an AdminBSB overlined text. |
|
64
|
|
|
* |
|
65
|
|
|
* @param array $args The arguments. |
|
66
|
|
|
* @return string Returns the AdminBSB overlined text. |
|
67
|
|
|
*/ |
|
68
|
|
|
public function adminBSBOverlineFunction(array $args = []) { |
|
69
|
|
|
return $this->adminBSBOverline(ArrayHelper::get($args, "content")); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* Displays an AdminBSB underline text. |
|
74
|
|
|
* |
|
75
|
|
|
* @param array $args The arguments. |
|
76
|
|
|
* @return string Returns the AdminBSB underline text. |
|
77
|
|
|
*/ |
|
78
|
|
|
public function adminBSBUnderlineFunction(array $args = []) { |
|
79
|
|
|
return $this->adminBSBUnderline(ArrayHelper::get($args, "content")); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* Get the Twig filters. |
|
84
|
|
|
* |
|
85
|
|
|
* @return Twig_SimpleFilter[] Returns the Twig filters. |
|
86
|
|
|
*/ |
|
87
|
|
|
public function getFilters() { |
|
88
|
|
|
return []; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* Get the Twig functions. |
|
93
|
|
|
* |
|
94
|
|
|
* @return array Returns the Twig functions. |
|
95
|
|
|
*/ |
|
96
|
|
|
public function getFunctions() { |
|
97
|
|
|
return [ |
|
98
|
|
|
new Twig_SimpleFunction("adminBSBBold", [$this, "adminBSBBoldFunction"], ["is_safe" => ["html"]]), |
|
99
|
|
|
new Twig_SimpleFunction("adminBSBDeleted", [$this, "bootstrapDeletedFunction"], ["is_safe" => ["html"]]), |
|
100
|
|
|
new Twig_SimpleFunction("adminBSBHeading1", [$this, "bootstrapHeading1Function"], ["is_safe" => ["html"]]), |
|
101
|
|
|
new Twig_SimpleFunction("adminBSBHeading2", [$this, "bootstrapHeading2Function"], ["is_safe" => ["html"]]), |
|
102
|
|
|
new Twig_SimpleFunction("adminBSBHeading3", [$this, "bootstrapHeading3Function"], ["is_safe" => ["html"]]), |
|
103
|
|
|
new Twig_SimpleFunction("adminBSBHeading4", [$this, "bootstrapHeading4Function"], ["is_safe" => ["html"]]), |
|
104
|
|
|
new Twig_SimpleFunction("adminBSBHeading5", [$this, "bootstrapHeading5Function"], ["is_safe" => ["html"]]), |
|
105
|
|
|
new Twig_SimpleFunction("adminBSBHeading6", [$this, "bootstrapHeading6Function"], ["is_safe" => ["html"]]), |
|
106
|
|
|
new Twig_SimpleFunction("adminBSBInserted", [$this, "bootstrapInsertedFunction"], ["is_safe" => ["html"]]), |
|
107
|
|
|
new Twig_SimpleFunction("adminBSBItalic", [$this, "adminBSBItalicFunction"], ["is_safe" => ["html"]]), |
|
108
|
|
|
new Twig_SimpleFunction("adminBSBLineThrough", [$this, "adminBSBLineThroughFunction"], ["is_safe" => ["html"]]), |
|
109
|
|
|
new Twig_SimpleFunction("adminBSBMarked", [$this, "bootstrapMarkedFunction"], ["is_safe" => ["html"]]), |
|
110
|
|
|
new Twig_SimpleFunction("adminBSBOverline", [$this, "adminBSBOverlineFunction"], ["is_safe" => ["html"]]), |
|
111
|
|
|
new Twig_SimpleFunction("adminBSBSmall", [$this, "bootstrapSmallFunction"], ["is_safe" => ["html"]]), |
|
112
|
|
|
new Twig_SimpleFunction("adminBSBUnderline", [$this, "adminBSBUnderlineFunction"], ["is_safe" => ["html"]]), |
|
113
|
|
|
]; |
|
114
|
|
|
} |
|
115
|
|
|
} |
|
116
|
|
|
|