@@ -98,6 +98,48 @@ <h2>Arguments</h2>
98
98
99
99
< p > The following arguments are available for the split ViewHelper: </ p >
100
100
< dl class ="confval ">
101
+ < dt id ="viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-limit " class ="d-flex justify-content-between ">
102
+ < div class ="confval-header ">
103
+ < code class ="sig-name descname "> < span class ="pre "> limit</ span > </ code >
104
+ < a class ="headerlink " href ="#viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-limit " data-bs-toggle ="modal " data-bs-target ="#linkReferenceModal " data-id ="viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-limit " data-rstCode =":typo3:viewhelper-argument:`limit <somemanual:typo3fluid-fluid-viewhelpers-splitviewhelper-limit>` " title ="Reference this configuration value "> ¶</ a >
105
+ </ div >
106
+ < div class ="confval-back-to-top "> < a href ="# " class ="backToTop " title ="Back to top "> < i class ="fa-solid fa-arrow-up fa-xs "> </ i > </ a > </ div >
107
+ </ dt >
108
+ < dd >
109
+ < dl class ="field-list simple ">
110
+ < dt class ="field "> Type</ dt >
111
+ < dd class ="field "> int
112
+ </ dd >
113
+ < dt class ="field "> Default</ dt >
114
+ < dd class ="field "> 0
115
+ </ dd >
116
+ </ dl >
117
+ < div class ="confval-description ">
118
+ If limit is positive, a maximum of $limit items will be returned. If limit is negative, all items except for the last $limit items will be returned. 0 will be treated as 1.
119
+ </ div >
120
+ </ dd >
121
+ </ dl > < dl class ="confval ">
122
+ < dt id ="viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-separator " class ="d-flex justify-content-between ">
123
+ < div class ="confval-header ">
124
+ < code class ="sig-name descname "> < span class ="pre "> separator</ span > </ code >
125
+ < a class ="headerlink " href ="#viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-separator " data-bs-toggle ="modal " data-bs-target ="#linkReferenceModal " data-id ="viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-separator " data-rstCode =":typo3:viewhelper-argument:`separator <somemanual:typo3fluid-fluid-viewhelpers-splitviewhelper-separator>` " title ="Reference this configuration value "> ¶</ a >
126
+ </ div >
127
+ < div class ="confval-back-to-top "> < a href ="# " class ="backToTop " title ="Back to top "> < i class ="fa-solid fa-arrow-up fa-xs "> </ i > </ a > </ div >
128
+ </ dt >
129
+ < dd >
130
+ < dl class ="field-list simple ">
131
+ < dt class ="field "> Type</ dt >
132
+ < dd class ="field "> string
133
+ </ dd >
134
+ < dt class ="field "> Required</ dt >
135
+ < dd class ="field "> 1
136
+ </ dd >
137
+ </ dl >
138
+ < div class ="confval-description ">
139
+ Separator string to explode with
140
+ </ div >
141
+ </ dd >
142
+ </ dl > < dl class ="confval ">
101
143
< dt id ="viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-value " class ="d-flex justify-content-between ">
102
144
< div class ="confval-header ">
103
145
< code class ="sig-name descname "> < span class ="pre "> value</ span > </ code >
@@ -118,11 +160,123 @@ <h2>Arguments</h2>
118
160
The string to explode
119
161
</ div >
120
162
</ dd >
163
+ </ dl >
164
+
165
+
166
+ < p > The SplitViewHelper splits a string by the specified separator, which
167
+ results in an array. The number of values in the resulting array can
168
+ be limited with the limit parameter, which results in an array where
169
+ the last item contains the remaining unsplit string.
170
+ This ViewHelper mimicks PHP's < code class ="code-inline " translate ="no " aria-description ="PHP " aria-details ="Dynamic server-side scripting language. "> explode()</ code > function.</ p >
171
+ < section class ="section " id ="examples ">
172
+ < h2 > Examples< a class ="headerlink " href ="#examples " data-bs-toggle ="modal " data-bs-target ="#linkReferenceModal " title ="Reference this headline "> ¶</ a > </ h2 >
173
+ < section class ="section " id ="split-with-a-separator ">
174
+ < h3 > Split with a separator< a class ="headerlink " href ="#split-with-a-separator " data-bs-toggle ="modal " data-bs-target ="#linkReferenceModal " title ="Reference this headline "> ¶</ a > </ h3 >
175
+ < div class ="code-block-wrapper " translate ="no ">
176
+
177
+ < pre class ="code-block "> < code > <f:split value="1,5,8" separator="," /></ code > </ pre >
178
+ < div > < button class ="code-block-copy " title ="Copy to clipboard ">
179
+ < i class ="icon fa-regular fa-copy code-block-copy-icon "> </ i >
180
+ < i class ="fa-solid fa-check code-block-check-icon code-block-hide "> </ i >
181
+ </ button >
182
+ < span class ="code-block-check-tooltip code-block-hide " aria-live ="polite "> Copied!</ span >
183
+ </ div >
184
+ </ div >
185
+ < div class ="code-block-wrapper " translate ="no ">
186
+
187
+ < pre class ="code-block "> < code class ="hljs plaintext "> {0: '1', 1: '5', 2: '8'}</ code > </ pre >
188
+ < div > < button class ="code-block-copy " title ="Copy to clipboard ">
189
+ < i class ="icon fa-regular fa-copy code-block-copy-icon "> </ i >
190
+ < i class ="fa-solid fa-check code-block-check-icon code-block-hide "> </ i >
191
+ </ button >
192
+ < span class ="code-block-check-tooltip code-block-hide " aria-live ="polite "> Copied!</ span >
193
+ </ div >
194
+ </ div >
195
+ </ section >
196
+ < section class ="section " id ="split-using-tag-content-as-value ">
197
+ < h3 > Split using tag content as value< a class ="headerlink " href ="#split-using-tag-content-as-value " data-bs-toggle ="modal " data-bs-target ="#linkReferenceModal " title ="Reference this headline "> ¶</ a > </ h3 >
198
+ < div class ="code-block-wrapper " translate ="no ">
199
+
200
+ < pre class ="code-block "> < code > <f:split separator="-">1-5-8</f:split></ code > </ pre >
201
+ < div > < button class ="code-block-copy " title ="Copy to clipboard ">
202
+ < i class ="icon fa-regular fa-copy code-block-copy-icon "> </ i >
203
+ < i class ="fa-solid fa-check code-block-check-icon code-block-hide "> </ i >
204
+ </ button >
205
+ < span class ="code-block-check-tooltip code-block-hide " aria-live ="polite "> Copied!</ span >
206
+ </ div >
207
+ </ div >
208
+ < div class ="code-block-wrapper " translate ="no ">
209
+
210
+ < pre class ="code-block "> < code class ="hljs plaintext "> {0: '1', 1: '5', 2: '8'}</ code > </ pre >
211
+ < div > < button class ="code-block-copy " title ="Copy to clipboard ">
212
+ < i class ="icon fa-regular fa-copy code-block-copy-icon "> </ i >
213
+ < i class ="fa-solid fa-check code-block-check-icon code-block-hide "> </ i >
214
+ </ button >
215
+ < span class ="code-block-check-tooltip code-block-hide " aria-live ="polite "> Copied!</ span >
216
+ </ div >
217
+ </ div >
218
+ </ section >
219
+ < section class ="section " id ="split-with-a-limit ">
220
+ < h3 > Split with a limit< a class ="headerlink " href ="#split-with-a-limit " data-bs-toggle ="modal " data-bs-target ="#linkReferenceModal " title ="Reference this headline "> ¶</ a > </ h3 >
221
+ < div class ="code-block-wrapper " translate ="no ">
222
+
223
+ < pre class ="code-block "> < code > <f:split value="1,5,8" separator="," limit="2" /></ code > </ pre >
224
+ < div > < button class ="code-block-copy " title ="Copy to clipboard ">
225
+ < i class ="icon fa-regular fa-copy code-block-copy-icon "> </ i >
226
+ < i class ="fa-solid fa-check code-block-check-icon code-block-hide "> </ i >
227
+ </ button >
228
+ < span class ="code-block-check-tooltip code-block-hide " aria-live ="polite "> Copied!</ span >
229
+ </ div >
230
+ </ div >
231
+ < div class ="code-block-wrapper " translate ="no ">
232
+
233
+ < pre class ="code-block "> < code class ="hljs plaintext "> {0: '1', 1: '5,8'}</ code > </ pre >
234
+ < div > < button class ="code-block-copy " title ="Copy to clipboard ">
235
+ < i class ="icon fa-regular fa-copy code-block-copy-icon "> </ i >
236
+ < i class ="fa-solid fa-check code-block-check-icon code-block-hide "> </ i >
237
+ </ button >
238
+ < span class ="code-block-check-tooltip code-block-hide " aria-live ="polite "> Copied!</ span >
239
+ </ div >
240
+ </ div >
241
+ </ section >
242
+ </ section >
243
+
244
+ < h2 > Source code</ h2 >
245
+
246
+ < p >
247
+ Go to the source code of this ViewHelper:
248
+ < a href ="https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/SplitViewHelper.php "> SplitViewHelper.php (GitHub)</ a > .
249
+ </ p >
250
+
251
+ < h2 > Arguments</ h2 >
252
+
253
+ < p > The following arguments are available for the split ViewHelper: </ p >
254
+ < dl class ="confval ">
255
+ < dt class ="d-flex justify-content-between ">
256
+ < div class ="confval-header ">
257
+ < code class ="sig-name descname "> < span class ="pre "> value</ span > </ code >
258
+ < span class ="headerNoindex " title ="This configuration value cannot be linked directly. Consider to link to the section above. "> < i class ="fa-solid fa-link-slash "> </ i > </ span >
259
+ </ div >
260
+ < div class ="confval-back-to-top "> < a href ="# " class ="backToTop " title ="Back to top "> < i class ="fa-solid fa-arrow-up fa-xs "> </ i > </ a > </ div >
261
+ </ dt >
262
+ < dd >
263
+ < dl class ="field-list simple ">
264
+ < dt class ="field "> Type</ dt >
265
+ < dd class ="field "> string
266
+ </ dd >
267
+ < dt class ="field "> Default</ dt >
268
+ < dd class ="field "> ''
269
+ </ dd >
270
+ </ dl >
271
+ < div class ="confval-description ">
272
+ The string to explode
273
+ </ div >
274
+ </ dd >
121
275
</ dl > < dl class ="confval ">
122
- < dt id =" viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-separator " class ="d-flex justify-content-between ">
276
+ < dt class ="d-flex justify-content-between ">
123
277
< div class ="confval-header ">
124
278
< code class ="sig-name descname "> < span class ="pre "> separator</ span > </ code >
125
- < a class ="headerlink " href =" #viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-separator " data-bs-toggle =" modal " data-bs-target =" #linkReferenceModal " data-id =" viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-separator " data-rstCode =" :typo3:viewhelper-argument:`separator <somemanual:typo3fluid-fluid-viewhelpers-splitviewhelper-separator>` " title =" Reference this configuration value " > ¶ </ a >
279
+ < span class ="headerNoindex " title =" This configuration value cannot be linked directly. Consider to link to the section above. " > < i class =" fa-solid fa-link-slash " > </ i > </ span >
126
280
</ div >
127
281
< div class ="confval-back-to-top "> < a href ="# " class ="backToTop " title ="Back to top "> < i class ="fa-solid fa-arrow-up fa-xs "> </ i > </ a > </ div >
128
282
</ dt >
@@ -140,10 +294,10 @@ <h2>Arguments</h2>
140
294
</ div >
141
295
</ dd >
142
296
</ dl > < dl class ="confval ">
143
- < dt id =" viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-limit " class ="d-flex justify-content-between ">
297
+ < dt class ="d-flex justify-content-between ">
144
298
< div class ="confval-header ">
145
299
< code class ="sig-name descname "> < span class ="pre "> limit</ span > </ code >
146
- < a class ="headerlink " href =" #viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-limit " data-bs-toggle =" modal " data-bs-target =" #linkReferenceModal " data-id =" viewhelper-argument-typo3fluid-fluid-viewhelpers-splitviewhelper-limit " data-rstCode =" :typo3:viewhelper-argument:`limit <somemanual:typo3fluid-fluid-viewhelpers-splitviewhelper-limit>` " title =" Reference this configuration value " > ¶ </ a >
300
+ < span class ="headerNoindex " title =" This configuration value cannot be linked directly. Consider to link to the section above. " > < i class =" fa-solid fa-link-slash " > </ i > </ span >
147
301
</ div >
148
302
< div class ="confval-back-to-top "> < a href ="# " class ="backToTop " title ="Back to top "> < i class ="fa-solid fa-arrow-up fa-xs "> </ i > </ a > </ div >
149
303
</ dt >
0 commit comments