public function FlexiformBuilder::form in Flexiform 7
Build the form for this flexiform.
Overrides FlexiformBuilderInterface::form
2 calls to FlexiformBuilder::form()
- FlexiformBuilderEntityForm::form in includes/
builder/ entity_form.builder.inc - Attach all fields for this entity to the form.
- FlexiformBuilderFlexiform::form in includes/
builder/ flexiform.builder.inc - Build the form for this flexiform.
2 methods override FlexiformBuilder::form()
- FlexiformBuilderEntityForm::form in includes/
builder/ entity_form.builder.inc - Attach all fields for this entity to the form.
- FlexiformBuilderFlexiform::form in includes/
builder/ flexiform.builder.inc - Build the form for this flexiform.
File
- includes/
flexiform.builder.inc, line 67 - Specify builder classes for flexiforms.
Class
- FlexiformBuilder
- Base class for flexiform builders.
Code
public function form($form, &$form_state) {
$form['#flexiform'] = $this->flexiform;
$form['#flexiform_base_entity'] = $this->base_entity;
$form['#flexiform_builder'] = $this;
$form['#theme'] = array(
'flexiform__' . $this->flexiform->form,
'flexiform',
);
$form['#contextual_links']['flexiform'] = array(
'admin/structure/flexiforms/manage',
array(
$this->flexiform->form,
),
);
$form['#attributes']['class'][] = 'flexiform--' . str_replace('_', '-', $this->flexiform->form);
return $form;
}