You are here

function entity_example_basic_form_submit in Examples for Developers 7

Form submit handler: Submits basic_add_form information.

Related topics

File

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

Code

function entity_example_basic_form_submit($form, &$form_state) {
  $entity = $form_state['values']['basic_entity'];
  $entity->item_description = $form_state['values']['item_description'];
  field_attach_submit('entity_example_basic', $entity, $form, $form_state);
  $entity = entity_example_basic_save($entity);
  $form_state['redirect'] = 'examples/entity_example/basic/' . $entity->basic_id;
}