Skip to content

Instantly share code, notes, and snippets.

View sushantpaste's full-sized avatar

sushant sushantpaste

View GitHub Profile
/**
* Implements hook_views_api().
* Used for enabling using templates inside my module.
*/
function ModuleName_views_api() {
return array( "version" => "3.0", "template path" => drupal_get_path('module','ModuleName') . '/templates' );
}
$form = new Entityform(array('type' = 'my_entitty_form', 'language' => LANGUAGE_NONE));
$form->field_entityform_1 = array(LANGUAGE_NONE => array(array('value' => 'field_1')));
$form->field_entityform_2 = array(LANGUAGE_NONE => array(array('value' => 'field_2' )));
$form->uid = 1; // this is the form id
entityform_save($form);