Skip to content

Commit bd0c528

Browse files
update
1 parent 2034b94 commit bd0c528

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,23 @@ $form->post()->rules([
111111
- Helpers available to assist on easy configuration
112112
- `config_form()`
113113

114-
| Array Keys | Description |
114+
| Keys | Description |
115115
|-------------|-----------------------------------------|
116116
| request | String `POST\|GET\|ALL` Default `POST` |
117117
| error_type | Boolean `true\|false` Default `false` |
118118
| csrf_token | Boolean `true\|false` Default `true` |
119-
| class | Array `error\|success` error class type to be returned on both success and failure |
119+
| class | Assoc Array `error\|success` error class type to be returned on both success and failure |
120120

121121
```
122-
config_form([
123-
'request' => 'POST',
124-
'error_type' => true,
125-
'csrf_token' => true,
126-
'class' => [
122+
config_form(
123+
request : 'POST',
124+
error_type : true,
125+
csrf_token : true,
126+
class : [
127127
'error' => 'alert alert-danger',
128128
'success' => 'alert alert-success'
129129
]
130-
]);
130+
);
131131
```
132132

133133
## Csrf

src/Methods/ValidatorMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public static function old($key = null, $default = null)
264264

265265
// if not empty and segment count is 1
266266
if(!empty($data) && count($keySegments) === 1){
267-
return $data;
267+
return is_array($data) ? $data[0] ?? $data[""] ?? "" : $data;
268268
}
269269

270270
// return data or default

0 commit comments

Comments
 (0)