You are here

public function BeanTestPlugin::form in Bean (for Drupal 7) 7

The Plugin Form

The Bean object will be either loaded from the database or filled with the defaults.

_state

Parameters

$bean:

$form:

Return value

array form array

Overrides BeanPlugin::form

File

tests/bean_test.module, line 72
Primary hook implementations for the Bean Test module.

Class

BeanTestPlugin

Code

public function form($bean, $form, &$form_state) {
  $form = array();
  $form['test_boolean'] = array(
    '#type' => 'textfield',
    '#title' => t('String'),
    '#default_value' => $bean->test_string,
  );
  $form['test_boolean'] = array(
    '#type' => 'checkbox',
    '#title' => t('Boolean'),
    '#default_value' => $bean->test_boolean,
  );
  $form['test_array'] = array(
    '#type' => 'string',
    '#title' => t('Array'),
    '#default_value' => $bean->test_array['test_array_1'],
  );
  return $form;
}