Skip to content

Instantly share code, notes, and snippets.

@opi
Created June 12, 2012 18:19
Show Gist options
  • Save opi/2919150 to your computer and use it in GitHub Desktop.
Save opi/2919150 to your computer and use it in GitHub Desktop.
Drupal 7 : Programmatically display node_form
$node = (object) array(
'uid' => UID,
'name' => NAME,
'type' => TYPE,
'language' => LANGCODE,
);
$form_state['build_info']['args'] = array($node);
form_load_include($form_state, 'inc', 'node', 'node.pages');
$output = drupal_build_form('TYPE_node_form', $form_state);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment