function form_test_two_instances

Menu callback that returns two instances of the node form.

1 string reference to 'form_test_two_instances'
form_test_menu in modules/simpletest/tests/form_test.module
Implements hook_menu().

File

modules/simpletest/tests/form_test.module, line 1921

Code

function form_test_two_instances() {
    global $user;
    $node1 = (object) array(
        'uid' => $user->uid,
        'name' => isset($user->name) ? $user->name : '',
        'type' => 'page',
        'language' => LANGUAGE_NONE,
    );
    $node2 = clone $node1;
    $return['node_form_1'] = drupal_get_form('page_node_form', $node1);
    $return['node_form_2'] = drupal_get_form('page_node_form', $node2);
    return $return;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.