You are here

function entity_example_basic_add in Examples for Developers 7

Provides a wrapper on the edit form to add a new entity.

Related topics

1 string reference to 'entity_example_basic_add'
entity_example_menu in entity_example/entity_example.module
Implements hook_menu().

File

entity_example/entity_example.module, line 398
Implements the basic functionality required to create and display an entity.

Code

function entity_example_basic_add() {

  // Create a basic entity structure to be used and passed to the validation
  // and submission functions.
  $entity = entity_get_controller('entity_example_basic')
    ->create();
  return drupal_get_form('entity_example_basic_form', $entity);
}