drupal - How to display a custom form in a newly created template page -
i have hook_form
in custom module , have customized page.tpl.php
file .is there way can pass form tpl page.i thought of passing $form variable tpl page through hook_theme
function quite not working.
the standard method use preprocess function, either in theme or module
function mymodule_preprocess_page(&$vars) { $vars['some_form'] = drupal_get_form('mymodule_some_form'); }
then in template file:
<?php echo $some_form; ?>
you'll need clear caches after implementing hook theme registry pick up.
Comments
Post a Comment