You are here

function hook_form_builder_form_types in Form Builder 7

Same name and namespace in other branches
  1. 7.2 form_builder.api.php \hook_form_builder_form_types()

Define form builder form types and their element types.

Return value

An associative array of form type definitions. Each definition is an associative array:

  • class: This has to be the fully qualified name of an autoloadable class implementing the FormBuilderFormInterface. If no class is passed it defaults to 'FormBuilderFormBase'.
  • element class: The default class used for elements.
  • property class: The default class used for properties.

The full definition is passed to the constructor of the class, so other array keys can be used to pass additional parameters.

2 functions implement hook_form_builder_form_types()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

form_builder_examples_form_builder_form_types in examples/form_builder_examples.module
Implements hook_form_builder_form_types().
form_builder_webform_form_builder_form_types in modules/webform/form_builder_webform.module
Implements hook_form_builder_form_types().
2 invocations of hook_form_builder_form_types()
FormBuilderLoader::loadFormTypeInfo in ./form_builder.classes.inc
form_builder_requirements in ./form_builder.install
Implementation of hook_requirements().

File

./form_builder.api.php, line 27
These are the hooks that are invoked by Form Builder.

Code

function hook_form_builder_form_types() {
  $types['example'] = array(
    'class' => 'ExampleFormBuilderForm',
    'element class' => 'ExampleFormBuilderElement',
    'property class' => 'ExampleFormBuilderProperty',
    'parameter1' => 'test',
  );
  return $types;
}