summaryrefslogtreecommitdiff
path: root/snippets/twig.snippets
blob: 8102984dfd3b4ec46bb31932695729398da2659f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Tags
snippet apply "twig apply"
	{% apply ${1} %}
		${0}
	{% endapply %}
snippet autoescape "twig autoescape"
	{% autoescape %}
		${0}
	{% endautoescape %}
snippet endautoescape "twig endautoescape"
	{% endautoescape %}${0}
snippet bl "twig block"
	{% block ${1} %}
		${0}
	{% endblock %}
snippet block "twig block"
	{% block ${1} %}
		${0}
	{% endblock %}
snippet endblock "twig endblock"
	{% endblock %}${0}
snippet cache "twig cache"
	{% cache %}
		${0}
	{% endcache %}
snippet endcache "twig endcache"
	{% endcache %}${0}
snippet css "twig css"
	{% css %}
		${0}
	{% endcss %}
snippet endcss "twig endcss"
	{% endcss %}${0}
snippet dd "twig dd"
	{% dd ${1} %}${0}
snippet do "twig do"
	{% do ${1} %}${0}
snippet embed "twig embed"
	{% embed "${1}" %}
		${0}
	{% endembed %}
snippet endembed "twig endembed"
	{% endembed %}${0}
snippet exit "twig exit"
	{% exit ${1} %}
snippet extends "twig extends"
	{% extends "${1}" %}${0}
snippet ext "twig extends"
	{% extends "${1}" %}${0}
snippet for "twig for"
	{% for ${1} in ${2} %}
		${0}
	{% endfor %}
snippet fore "twig for else"
	{% for ${1} in ${2} %}
		${3}
	{% else %}
		${0}
	{% endfor %}
snippet endfor "twig endfor"
	{% endfor %}${0}
snippet from "twig from"
	{% from "${1}" import ${2} %}${0}
snippet header "twig header"
	{% header "${1}" %}${0}
snippet hook "twig hook"
	{% hook "${1}" %}${0}
snippet html "twig html"
	{% html %}
		${0}
	{% endhtml %}
snippet endhtml "twig endhtml"
	{% endhtml %}${0}
snippet if "twig if"
	{% if ${1} %}
		${0}
	{% endif %}
snippet ife "twig if else"
	{% if ${1} %}
		${2}
	{% else %}
		${0}
	{% endif %}
snippet el "twig else"
	{% else %}
snippet eif "twig elseif"
	{% elseif ${1} %}
		${0}
snippet endif "twig endif"
	{% endif %}${0}
snippet import "twig import"
	{% import "${1}" as ${2} %}${0}
snippet include "twig include"
	{% include "${1}" %}${0}
snippet includewith "twig include with parameters"
	{% include "${1}" with ${2} %}${0}
snippet js "twig js"
	{% js %}
		${0}
	{% endjs %}
snippet endjs "twig endjs"
	{% endjs %}${0}
snippet macro "twig macro"
	{% macro ${1}(${2}) %}
		${0}
	{% endmacro %}
snippet endmacro "twig endmacro"
	{% endmacro %}${0}
snippet namespace "twig namespace"
	{% namespace "${1}" %}
		${0}
	{% endnamespace %}
snippet endnamespace "twig endnamespace"
	{% endnamespace %}${0}
snippet nav "twig nav"
	{% nav ${1} in ${2} %}
		${0}
	{% endnav %}
snippet endnav "twig endnav"
	{% endnav %}${0}
snippet paginate "twig paginate"
	{% paginate ${1} as ${2} %}${0}
snippet redirect "twig redirect"
	{% redirect "${1}" %}${0}
snippet requireguest "twig requireguest"
	{% requireGuest %}${0}
snippet requirelogin "twig requirelogin"
	{% requireLogin %}${0}
snippet requirepermission "twig requirepermission"
	{% requirePermission "${1}" %}${0}
snippet set "twig set"
	{% set ${1} = ${2} %}${0}
snippet setb "twig set block"
	{% set ${1} %}
		${0}
	{% endset %}
snippet endset "twig endset"
	{% endset %}${0}
snippet switch "twig switch"
	{% switch ${1} %}
		{% case "${2}" %}
			${0}
		{% default %}
			
	{% endswitch %}
snippet case "twig switch case"
	{% case "${1}" %}
		${0}
snippet default "twig switch default"
	{% default %}
		${0}
snippet endswitch "twig endswitch"
	{% endswitch %}${0}
snippet use "twig use"
	{% use "${1}" %}${0}
snippet verbatim "twig verbatim"
	{% verbatim %}
		${0}
	{% endverbatim %}
snippet endverbatim "twig endverbatim"
	{% endverbatim %}${0}
snippet with "twig with"
	{% with %}
		${0}
	{% endwith %}
snippet endwith "twig endwith"
	{% endwith %}${0}

# Functions
snippet dump "twig dump"
	<pre>
		{{ dump(${1}) }}
	</pre>

# Filters
snippet translate "twig translate"
	{{ "${1}"|t }}${0}