ArrayContext (class)

Class ArrayContext

Provides a basic array based context provider for FormHelper.

This adapter is useful in testing or when you have forms backed by simple array data structures.

Important keys:

  • defaults The default values for fields. These values will be used when there is no request 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.
  • schema An array of data that emulate the column structures that Cake\Database\Schema\Table 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