| Versionen | |
|---|---|
| drupal7 | hook_field_info() |
Define Field API field types.
An array whose keys are field type names and whose values are:
label: TODO description: TODO settings: TODO instance_settings: TODO default_widget: TODO default_formatter: TODO behaviors: TODO
modules/
<?php
function hook_field_info() {
return array(
'text' => array(
'label' => t('Text'),
'description' => t('This field stores varchar text in the database.'),
'settings' => array('max_length' => 255),
'instance_settings' => array('text_processing' => 0),
'default_widget' => 'text_textfield',
'default_formatter' => 'text_default',
),
'textarea' => array(
'label' => t('Textarea'),
'description' => t('This field stores long text in the database.'),
'instance_settings' => array('text_processing' => 0),
'default_widget' => 'text_textarea',
'default_formatter' => 'text_default',
),
);
}
?>
Kommentare
Kommentar hinzufügen