function hook_flexiform_builder_info in Flexiform 7
Register builder classes with the Flexiform system.
Builders are used to turn the configuration stored in the flexiform entity into a usable FAPI form.
Return value
An array whose keys are unique builder machine-names and whose values are arrays of important information about the builders that must contain the following keys:
- class: The name of the class used to build the form.
- label: The human-readable name of the builder.
- description: A description that will be used as help text on the flexiform config form.
- entity_types: An array of entity types that this builder can build forms for. Defaults to all entity types if left blank.
1 function implements hook_flexiform_builder_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- flexiform_flexiform_builder_info in ./
flexiform.flexiform.inc - Implements hook_flexiform_builder_info().
1 invocation of hook_flexiform_builder_info()
- flexiform_builder_info in ./
flexiform.module - Get info about all available builders.
File
- ./
flexiform.api.php, line 151 - API documentation for Flexiform.
Code
function hook_flexiform_builder_info() {
$builders = array();
$builders['FlexiformBuilderFlexiform'] = array(
'class' => 'FlexiformBuilderFlexiform',
'label' => t('Flexiform Form Builder'),
'description' => t('The flexiform custom form builder. Use the configuration pages to add fields and entities to the form.'),
);
$fieldable_entities = array();
foreach (entity_get_info() as $entity_type => $info) {
if ($info['fieldable']) {
$fieldable_entities[] = $entity_type;
}
}
$builders['FlexiformBuilderEntityForm'] = array(
'class' => 'FlexiformBuilderEntityForm',
'label' => t('Entity Field Form'),
'description' => t('Render the standard entity field form.'),
'entity_types' => $fieldable_entities,
);
return $builders;
}