@@ -27,18 +27,17 @@ public function html(): string
27
27
28
28
extract ($ this ->controller ->output , EXTR_SKIP );
29
29
30
- return <<<HTML
31
- <!DOCTYPE html>
32
- <html lang="en">
33
- <head>
34
- <meta charset="utf-8">
35
- <meta name="viewport" content="width=device-width, initial-scale=1">
36
- <title> {$ doc }</title> {$ css }
37
- </head>
38
- <body> {$ log }{$ nav1 }{$ head }{$ main }{$ foot }{$ js }
39
- </body>
40
- </html>
41
- HTML ;
30
+ return '
31
+ <!DOCTYPE html>
32
+ <html lang="en">
33
+ <head>
34
+ <meta charset="utf-8">
35
+ <meta name="viewport" content="width=device-width, initial-scale=1">
36
+ <title> ' . $ doc . '</title> ' . $ css . '
37
+ </head>
38
+ <body> ' . $ head . $ log . $ nav1 . $ main . $ foot . $ js . '
39
+ </body>
40
+ </html> ' ;
42
41
}
43
42
44
43
public function nav1 (): string
@@ -61,9 +60,7 @@ public function nav_item(array $n): string
61
60
$ i = $ n [2 ] ?? '' ;
62
61
$ i = $ i ? "<i class= \"{$ i }\"></i> " : '' ;
63
62
64
- return <<<HTML
65
- <li class="nav-item {$ c }"><a class="nav-link" href=" {$ n [1 ]}"> {$ i }{$ n [0 ]}</a></li>
66
- HTML ;
63
+ return '<li class="nav-item ' . $ c . '"><a class="nav-link" href=" ' . $ n [1 ] . '"> ' . $ i . $ n [0 ] . '</a></li> ' ;
67
64
}
68
65
69
66
public function nav_dropdown (array $ a ): string
@@ -75,12 +72,10 @@ public function nav_dropdown(array $a): string
75
72
76
73
$ items = implode ('' , array_map (fn ($ n ) => $ this ->nav_item ($ n ), $ a [1 ]));
77
74
78
- return <<<HTML
79
- <li class="nav-item dropdown">
80
- <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown"> {$ i }{$ a [0 ]}</a>
81
- <div class="dropdown-menu"> {$ items }</div>
82
- </li>
83
- HTML ;
75
+ return '<li class="nav-item dropdown">
76
+ <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown"> ' . $ i . $ a [0 ] . '</a>
77
+ <div class="dropdown-menu"> ' . $ items . '</div>
78
+ </li> ' ;
84
79
}
85
80
86
81
public function list (array $ items ): string
@@ -100,16 +95,14 @@ public function list(array $items): string
100
95
$ content = htmlspecialchars ($ item ['content ' ] ?? '' );
101
96
$ plugin = $ this ->controller ->input ['plugin ' ];
102
97
103
- $ list .= <<<HTML
104
- <a href="?plugin= {$ plugin }&action=read&item= {$ id }" class="list-group-item">
105
- <h5>Item # {$ id }</h5>
106
- <p> {$ content }</p>
107
- <small> {$ updated }</small>
108
- </a>
109
- HTML ;
98
+ $ list .= '<a href="?plugin= ' . $ plugin . '&action=read&item= ' . $ id . '" class="list-group-item">
99
+ <h5>Item # ' . $ id . '</h5>
100
+ <p> ' . $ content . '</p>
101
+ <small> ' . $ updated . '</small>
102
+ </a> ' ;
110
103
}
111
104
112
- return " <div class=' list-group'> $ list</div> " ;
105
+ return ' <div class=" list-group"> ' . $ list . ' </div> ' ;
113
106
}
114
107
115
108
public function create (array $ input ): string
@@ -119,13 +112,11 @@ public function create(array $input): string
119
112
$ csrf = $ _SESSION ['csrf_token ' ] ?? '' ;
120
113
$ content = $ input ['content ' ] ?? '' ;
121
114
122
- return <<<HTML
123
- <form method="post">
124
- <input type="hidden" name="csrf_token" value=" {$ csrf }">
125
- <textarea name="content"> {$ content }</textarea>
115
+ return '<form method="post">
116
+ <input type="hidden" name="csrf_token" value=" ' . $ csrf . '">
117
+ <textarea name="content"> ' . $ content . '</textarea>
126
118
<button type="submit">Create</button>
127
- </form>
128
- HTML ;
119
+ </form> ' ;
129
120
}
130
121
131
122
public function read (array $ data ): string
@@ -140,14 +131,12 @@ public function read(array $data): string
140
131
$ id = $ data ['id ' ] ?? '0 ' ;
141
132
$ content = htmlspecialchars ($ data ['content ' ] ?? '' );
142
133
143
- return <<<HTML
144
- <div class="card">
134
+ return '<div class="card">
145
135
<div class="card-body">
146
- <h5>Item # { $ id} </h5>
147
- <p> { $ content} </p>
136
+ <h5>Item # ' . $ id . ' </h5>
137
+ <p> ' . $ content . ' </p>
148
138
</div>
149
- </div>
150
- HTML ;
139
+ </div> ' ;
151
140
}
152
141
153
142
public function __toString (): string
0 commit comments