Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   eZ Publish 4.x / legacy

 
eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Skip to end of metadata
Go to start of metadata

Internal FieldType conventions and best practices

FieldType->$settingsSchema and FieldType->$allowedValidators are intentionally left free-form, to give broadest freedom to FieldType developers. However, for internal FieldTypes (aka those delivered with eZ Publish), 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 FieldType 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>>>

Validators

Validators are internally handled through a special ValidatorService … (TBD: Explain service and how it works)

The following validators are available and carry the defined settings … (TBD: Collect validators and their settings)

  • No labels

1 Comment

  1. About "choice": I didn't make that one up. I saw it used in several FieldTypes, and thought it made sense.