Settings schema and allowed validators: comparison of v.2...
Versions Compared
Old Version 2
changes.mady.by.user Dominika Kurek
Saved on Apr 22, 2016
compared with
New Version Current
changes.mady.by.user Dominika Kurek
Saved on Apr 22, 2016
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Internal Field Type conventions and best practices
FieldType->$settingsSchema and FieldType->$allowedValidators are intentionally left free-form, to give broadest freedom to Field Type developers. However, for internal Field Types (aka those delivered with eZ PublishPlatform), a common standard should be established as best practice. The purpose of this page is to collect and unify this standard.
Settings schema
The general format of the settings schema of a Field Type is a hashmap of setting names, assigned to their type and default value, e.g.:
array(
'myFancySetting' => array(
'type' => 'int',
'default' => 23,
),
'myOtherFancySetting' => array(
'type' => 'string',
'default' => 'Sindelfingen',
),
);The type should be either a valid PHP type shortcut (TB discussed) or one of the following special types:
- Hash (a simple hash map)
- Choice (an enumeration)
- <<<YOUR TYPE HERE>>>
Comments
Add a comment