function entity_get_form

Returns the built and processed entity form for the given entity.

Parameters

EntityInterface $entity: The entity to be created or edited.

$operation: (optional) The operation identifying the form variation to be returned.

array $form_state: (optional) An associative array containing the current state of the form. Use this to pass additional information to the form, such as the langcode.

$form_state['langcode'] = $langcode;
$form = entity_get_form($entity, 'default', $form_state);

Return value

The processed form for the given entity and operation.

28 calls to entity_get_form()
AggregatorController::feedAdd in drupal/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
Presents the aggregator feed creation form.
block_admin_add in drupal/core/modules/block/block.admin.inc
Page callback: Build the block instance add form.
block_admin_edit in drupal/core/modules/block/block.admin.inc
Page callback: Build the block instance edit form.
comment_add in drupal/core/modules/comment/comment.module
Returns a rendered form to comment the given node.
ConfigTestController::edit in drupal/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestController.php
Presents the ConfigTest edit form.

... See full list

4 string references to 'entity_get_form'
aggregator_menu in drupal/core/modules/aggregator/aggregator.module
Implements hook_menu().
menu_menu in drupal/core/modules/menu/menu.module
Implements hook_menu().
taxonomy_menu in drupal/core/modules/taxonomy/taxonomy.module
Implements hook_menu().
user_menu in drupal/core/modules/user/user.module
Implements hook_menu().

File

drupal/core/includes/entity.inc, line 489
Entity API for handling entities like nodes or users.

Code

function entity_get_form(EntityInterface $entity, $operation = 'default', array $form_state = array()) {
  $form_state += entity_form_state_defaults($entity, $operation);
  $form_id = $form_state['build_info']['callback_object']
    ->getFormID();
  return drupal_build_form($form_id, $form_state);
}