Search code examples
phpdrupal-6

difference between print drupal_get_form and return drupal_get_form


what is the difference between

     print drupal_get_form('user_register');

and

    return drupal_get_form('user_register');

I am a newbie in drupal... I would be thankful to any explanation


Solution

  • in your callback if you write print drupal_get_form('form_id') then drupal prints the form in the callback, but if you write return drupal_get_form('form_id') then you must catch the returned html in a variable and then print the variable which contains the html of the form.