@@ -153,10 +153,11 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function addAttr($key, $value = null) |
| 155 | 155 | { |
| 156 | - if(is_array($key)) |
|
| 157 | - $this->attributes += $key; |
|
| 158 | - else |
|
| 159 | - $this->attributes[$key] = $value; |
|
| 156 | + if(is_array($key)) { |
|
| 157 | + $this->attributes += $key; |
|
| 158 | + } else { |
|
| 159 | + $this->attributes[$key] = $value; |
|
| 160 | + } |
|
| 160 | 161 | return $this; |
| 161 | 162 | } |
| 162 | 163 | |
@@ -170,8 +171,9 @@ discard block |
||
| 170 | 171 | { |
| 171 | 172 | if(property_exists($this, $source)) { |
| 172 | 173 | $property = $this->$source; |
| 173 | - if(!empty($property) && array_key_exists($key, $property)) |
|
| 174 | - return $property[$key]; |
|
| 174 | + if(!empty($property) && array_key_exists($key, $property)) { |
|
| 175 | + return $property[$key]; |
|
| 176 | + } |
|
| 175 | 177 | } |
| 176 | 178 | return null; |
| 177 | 179 | } |
@@ -251,15 +253,12 @@ discard block |
||
| 251 | 253 | if(in_array($tagName, ['text','password','date','time','file','hidden','reset'])) { |
| 252 | 254 | array_push($methodParams, $tagName); |
| 253 | 255 | $method = "input"; |
| 254 | - } |
|
| 255 | - elseif(in_array($tagName, ['checkbox','radio'])) { |
|
| 256 | + } elseif(in_array($tagName, ['checkbox','radio'])) { |
|
| 256 | 257 | array_push($methodParams, $tagName); |
| 257 | 258 | $method = "box"; |
| 258 | - } |
|
| 259 | - elseif($tagName == 'close') { |
|
| 259 | + } elseif($tagName == 'close') { |
|
| 260 | 260 | return '</form>'; |
| 261 | - } |
|
| 262 | - elseif($tagName == 'reset') { |
|
| 261 | + } elseif($tagName == 'reset') { |
|
| 263 | 262 | $this->datas = []; |
| 264 | 263 | } |
| 265 | 264 | $handler = [$this, $method]; |