@@ -14,8 +14,6 @@ Use [PHP Pug as Template engine](https://github.com/pug-php/pug)
14
14
15
15
## Twig Template Renderer
16
16
17
- Coming soon.
18
-
19
17
Use [ Twig as Template engine] ( https://twig.symfony.com/ )
20
18
21
19
> [ Twig Template renderer] ( https://github.com/antidot-framework/twig-template-renderer )
@@ -70,6 +68,12 @@ parameters:
70
68
templates :
71
69
extension : pug # pug|twig
72
70
template :
71
+ debug : false # only twig
72
+ file_extension : ' twig' # only twig
73
+ charset : ' utf-8' # only twig
74
+ auto_reload : false # only twig
75
+ autoescape : ' html' # only twig
76
+ strict_variables : true # only twig
73
77
pretty : true # only pug
74
78
expressionLanguage : js # only pug
75
79
pugjs : false # only pug
@@ -79,9 +83,10 @@ parameters:
79
83
globals :
80
84
title : Antidot Framework
81
85
filters : []
82
- keywords : []
83
- helpers : []
84
- default_params : => []
86
+ extensions : [] # only twig
87
+ keywords : [] # only pug
88
+ helpers : [] # only pug
89
+ default_params : => [] # only pug
85
90
` ` `
86
91
87
92
### **Symfony php**
@@ -94,22 +99,38 @@ declare(strict_types=1);
94
99
$config = [
95
100
' parameters' => [
96
101
' templates' => [
97
- ' extensino' => 'pug',
102
+ ' extensino' => 'pug', // only pug
98
103
],
99
104
' template' => [
100
- ' pretty' => true,
101
- ' expressionLanguage' => 'js',
102
- ' pugjs' => false,
103
- ' localsJsonFile' => false,
105
+ ' debug' => false, // only twig
106
+ ' file_extension' => 'twig', // only twig
107
+ ' charset' => 'utf-8', // only twig
108
+ ' auto_reload' => false, // only twig
109
+ ' autoescape' => 'html', // only twig
110
+ ' strict_variables' => true, // only twig
111
+ ' pretty' => true, // only pug
112
+ ' expressionLanguage' => 'js', // only pug
113
+ ' pugjs' => false, // only pug
114
+ ' localsJsonFile' => false, // only pug
104
115
' cache' => 'var/cache/pug',
105
116
' template_path' => 'templates/',
106
117
' globals' => [
107
118
' title' => 'Antidot Framework'
108
119
],
109
- ' filters' => [],
110
- ' keywords' => [],
111
- ' helpers' => [],
112
- ' default_params' => [],
120
+ ' filters' => [
121
+ // 'name' => PHPCallableClass::class,
122
+ // 'some_function' => 'php_some_function,
123
+ ],
124
+ ' extensions' => [ // only twig
125
+ // EtensionClassName::class,
126
+ ],
127
+ ' functions' => [ // only twig
128
+ // 'name' => PHPCallableClass::class,
129
+ // 'some_function' => 'php_some_function,
130
+ ],
131
+ ' keywords' => [], // only pug
132
+ ' helpers' => [], // only pug
133
+ ' default_params' => [], // only pug
113
134
],
114
135
],
115
136
];
@@ -119,20 +140,27 @@ $config = [
119
140
120
141
``` yaml
121
142
templates :
122
- extension : pug
143
+ extension : pug # pug|twig
123
144
template :
124
- pretty : true
125
- expressionLanguage : js
126
- pugjs : false
127
- localsJsonFile : false
145
+ debug : false # only twig
146
+ file_extension : ' twig' # only twig
147
+ charset : ' utf-8' # only twig
148
+ auto_reload : false # only twig
149
+ autoescape : ' html' # only twig
150
+ strict_variables : true # only twig
151
+ pretty : true # only pug
152
+ expressionLanguage : js # only pug
153
+ pugjs : false # only pug
154
+ localsJsonFile : false # only pug
128
155
cache : var/cache/pug
129
156
template_path : templates/
130
157
globals :
131
158
title : Antidot Framework
132
159
filters : []
133
- keywords : []
134
- helpers : []
135
- default_params : => []
160
+ extensions : [] # only twig
161
+ keywords : [] # only pug
162
+ helpers : [] # only pug
163
+ default_params : => [] # only pug
136
164
` ` `
137
165
138
166
### **Zend Style php**
@@ -144,23 +172,39 @@ declare(strict_types=1);
144
172
145
173
$config = [
146
174
' templates' => [
147
- ' extensino' => 'pug',
175
+ ' extensino' => 'pug', // only pug
148
176
],
149
177
' template' => [
150
- ' pretty' => true,
151
- ' expressionLanguage' => 'js',
152
- ' pugjs' => false,
153
- ' localsJsonFile' => false,
178
+ ' debug' => false, // only twig
179
+ ' file_extension' => 'twig', // only twig
180
+ ' charset' => 'utf-8', // only twig
181
+ ' auto_reload' => false, // only twig
182
+ ' autoescape' => 'html', // only twig
183
+ ' strict_variables' => true, // only twig
184
+ ' pretty' => true, // only pug
185
+ ' expressionLanguage' => 'js', // only pug
186
+ ' pugjs' => false, // only pug
187
+ ' localsJsonFile' => false, // only pug
154
188
' cache' => 'var/cache/pug',
155
189
' template_path' => 'templates/',
156
190
' globals' => [
157
191
' title' => 'Antidot Framework'
158
192
],
159
- ' filters' => [],
160
- ' keywords' => [],
161
- ' helpers' => [],
162
- ' default_params' => [],
163
- ],
193
+ ' filters' => [
194
+ // 'name' => PHPCallableClass::class,
195
+ // 'some_function' => 'php_some_function,
196
+ ],
197
+ ' extensions' => [ // only twig
198
+ // EtensionClassName::class,
199
+ ],
200
+ ' functions' => [ // only twig
201
+ // 'name' => PHPCallableClass::class,
202
+ // 'some_function' => 'php_some_function,
203
+ ],
204
+ ' keywords' => [], // only pug
205
+ ' helpers' => [], // only pug
206
+ ' default_params' => [], // only pug
207
+ ]
164
208
];
165
209
```
166
210
0 commit comments