Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tamedevelopers committed Aug 8, 2024
1 parent 2034b94 commit bd0c528
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,23 @@ $form->post()->rules([
- Helpers available to assist on easy configuration
- `config_form()`

| Array Keys | Description |
| Keys | Description |
|-------------|-----------------------------------------|
| request | String `POST\|GET\|ALL` Default `POST` |
| error_type | Boolean `true\|false` Default `false` |
| csrf_token | Boolean `true\|false` Default `true` |
| class | Array `error\|success` error class type to be returned on both success and failure |
| class | Assoc Array `error\|success` error class type to be returned on both success and failure |

```
config_form([
'request' => 'POST',
'error_type' => true,
'csrf_token' => true,
'class' => [
config_form(
request : 'POST',
error_type : true,
csrf_token : true,
class : [
'error' => 'alert alert-danger',
'success' => 'alert alert-success'
]
]);
);
```

## Csrf
Expand Down
2 changes: 1 addition & 1 deletion src/Methods/ValidatorMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public static function old($key = null, $default = null)

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

// return data or default
Expand Down

0 comments on commit bd0c528

Please sign in to comment.