-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabout.page
executable file
·49 lines (41 loc) · 1.21 KB
/
about.page
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
---
title: YAML
description: Simple YAML parser.
icon: 'M11.053.982 6.749 7.435V11.526H4.111V7.435L0 .982H2.965L5.579 5.137 8.215.982H11.053ZM15.483 9.181H10.708L9.737 11.526H7.622L12.093.982H14.256L18.545 11.526H16.286L15.482 9.181ZM14.689 7.084 13.226 3.215 11.593 7.084H14.689ZM4.111 12.684V23.018H6.328V15.89L8.649 20.681H10.394L12.794 15.721V23.016H14.921V12.684H12.017L9.44 17.358 6.985 12.684H4.111ZM24 20.775H18.546V12.684H16.286V22.974H24V20.775Z'
color: '#885933'
link: 'https://github.com/taufik-nurrohman/y-a-m-l'
author: Taufik Nurrohman
type: Markdown
version: 3.1.0
...
This extension converts YAML string to PHP data and/or PHP data to YAML string.
### Usage
Convert YAML string to array:
~~~ .php
$content = <<<YAML
key_1: value 1
key_2: value 2
key_3:
key_3_1: value 3.1
key_3_2: value 3.2
key_3_3: value 3.3
key_4: |
asdf asdf asdf
asdf asdf asdf
YAML;
echo From::YAML($content)->key_3->key_3_3;
~~~
Convert array to YAML string:
~~~ .php
$lot = [
'key_1' => 'value 1',
'key_2' => 'value 2',
'key_3' => [
'key_3_1' => 'value 3.1',
'key_3_2' => 'value 3.2',
'key_3_3' => 'value 3.3'
],
'key_4' => "asdf asdf asdf\nasdf asdf asdf\n"
];
echo To::YAML($lot);
~~~