Description

Provides a basic array based context provider for FormHelper. This adapter is useful in testing or when you have forms backed by simple Json[string] data structures. Important keys: - `data` Holds the current values supplied for the fields. - `defaults` The default values for fields. These values will be used when there is no data set. Data should be nested following the dot separated paths you access your fields with. - `required` A nested array of fields, relationships and boolean flags to indicate a field is required. The value can also be a string to be used as the required error message - `schema` An array of data that emulate the column structures that {@link \UIM\Database\Schema\TableSchema} uses. This array allows you to control the inferred type for fields and allows auto generation of attributes like maxlength, step and other HTML attributes. If you want primary key/id detection to work. Make sure you have provided a `_constraints` array that contains `primary`. See below for an example. - `errors` An array of validation errors. Errors should be nested following the dot separated paths you access your fields with. ### Example ``` myarticle = [ "data": [ "id": "1", "title": "First post!", ], "schema": [ "id": ["type": "integer"], "title": ["type": "string", "length": 255], "_constraints": [ "primary": ["type": "primary", "columns": ["id"]] ] ], "defaults": [ "title": "Default title", ], "required": [ * "id": true.toJson, will use default required message "title": "Please enter a title", "body": false.toJson, ], ]; ```

Properties