You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vybere hodnoty konkrétního klíče z každého prvku pole. Když máte pole záznamů (např. uživatelů, produktů), tento filtr vybere jen jedno pole z každého záznamu.
267
+
268
+
```latte
269
+
{var $users = [
270
+
[id: 30, name: 'John', age: 30],
271
+
[id: 32, name: 'Jane', age: 25],
272
+
[id: 33, age: 35],
273
+
]}
274
+
275
+
{$users|column: 'name'}
276
+
{* vrátí ['John', 'Jane'] *}
277
+
278
+
{$users|column: 'name', 'id'}
279
+
{* vrátí [30 => 'John', 32 => 'Jane'] *}
280
+
```
281
+
282
+
Pokud předáte `null` jako klíč sloupce, vrátí celé pole (užitečné, když chcete pouze přeindexovat podle `$indexKey`).
Joins array elements with a comma and space (`', '`). This is a convenient shortcut for the common use case of listing items in a human-readable format.
288
+
289
+
```latte
290
+
{var $items = ['apples', 'oranges', 'bananas']}
291
+
{$items|commas}
292
+
{* outputs 'apples, oranges, bananas' *}
293
+
```
294
+
295
+
You can optionally provide a custom separator for the last pair of items:
296
+
297
+
```latte
298
+
{$items|commas: ' and '}
299
+
{* outputs 'apples, oranges and bananas' *}
300
+
301
+
{=['PHP', 'JavaScript', 'Python']|commas: ', or '}
302
+
{* outputs 'PHP, JavaScript, or Python' *}
303
+
```
304
+
305
+
See also [#implode].
306
+
307
+
262
308
dataStream(string $mimetype='detect') .[filter]
263
309
-----------------------------------------------
264
310
Converts content to the data URI scheme. This allows embedding images into HTML or CSS without needing to link external files.
@@ -407,6 +453,8 @@ You can also use the alias `join`:
0 commit comments