phpdrupaldrupal-7drupal-fapidrupal-forms

Render a form in page.tpl.php


In my template.php I create a form and then in hook_preprocess_page function I assign it to a variable but how to I render it out in page.tpl.php

$variables['myform'] = drupal_get_form('test_myform');

Solution

  • You can try add the following line in your page.tpl.php

    print drupal_render($myform);
    

    Hope this works... Muhammad.