Registration form with Profile 2 fields

Public

</> CopyGet raw version
php
  1. $user_register_form = drupal_get_form('user_register_form');
  2. $profile = profile2_create(array('type' => 'patient'));
  3. $user_register_form_state = form_state_defaults();
  4. $user_register_form_state['profiles'] = array('patient' => $profile);
  5. profile2_attach_form($user_register_form, $user_register_form_state);
  6. $result = drupal_render($user_register_form);