@@ -51,8 +51,9 @@ discard block |
||
51 | 51 | public function createElementID($key) |
52 | 52 | { |
53 | 53 | $key = ucfirst($this->normalize($key)); |
54 | - if(strpos($key,'input')!==0) |
|
55 | - $key = 'input'.$key; |
|
54 | + if(strpos($key,'input')!==0) { |
|
55 | + $key = 'input'.$key; |
|
56 | + } |
|
56 | 57 | $this->set('id',$key); |
57 | 58 | return $this; |
58 | 59 | } |
@@ -65,8 +66,9 @@ discard block |
||
65 | 66 | { |
66 | 67 | !empty($token) or $token = microtime(true); |
67 | 68 | $token = $this->normalize($token); |
68 | - if(strpos($token,'form-')!==0) |
|
69 | - $token = 'form-'.$token; |
|
69 | + if(strpos($token,'form-')!==0) { |
|
70 | + $token = 'form-'.$token; |
|
71 | + } |
|
70 | 72 | $this->set('name',md5($token)); |
71 | 73 | return $this; |
72 | 74 | } |
@@ -156,16 +158,21 @@ discard block |
||
156 | 158 | { |
157 | 159 | AttributesMapper::filter($this); |
158 | 160 | $filtered = array_keys($attributes); |
159 | - if($ignore = $this->ignore->all()) |
|
160 | - $filtered = array_diff($filtered, $ignore); |
|
161 | + if($ignore = $this->ignore->all()) { |
|
162 | + $filtered = array_diff($filtered, $ignore); |
|
163 | + } |
|
161 | 164 | $attributes = array_intersect_key($attributes, array_flip($filtered)); |
162 | 165 | foreach($attributes as $key=>$value) |
163 | 166 | { |
164 | 167 | if(is_array($value)): |
165 | 168 | $output[]= $key.'="'.implode(' ',array_values($value)).'"'; |
166 | - else: |
|
169 | + else { |
|
170 | + : |
|
167 | 171 | if(is_numeric($key)) $output[]= $value; |
168 | - else $output[]= $key.'="'.$value.'"'; |
|
172 | + } |
|
173 | + else { |
|
174 | + $output[]= $key.'="'.$value.'"'; |
|
175 | + } |
|
169 | 176 | endif; |
170 | 177 | } |
171 | 178 | } |