My forms dont seem to have tags wrapping them in my templates. What am I doing wrong here?
I have a template whith some calls to theme() inside it. Two of these are forms with their own template. This template is called from a block_view().
my modules block function:
$form = drupal_get_form('stappenoverzicht_appointment_form');
$reset = drupal_get_form('stappenoverzicht_reset_form');
$block['content'] = theme('overzicht', array('status' => $status, 'links' =>$links, 'form' => $form, 'reset' => $reset));
my modules theme function:
$return['overzicht'] = array(
'variables' => array('status' => array(), 'links' => array(), 'form' => null,
'reset' => null),
'template' => 'templates/dashboard--stappen-overzicht',
'render element' => 'form',
);
$return['appointment'] = array(
'arguments' => array('form' => NULL),
'render element' => 'form',
'template' => 'templates/form--appointment',
);
$return['reset'] = array(
'arguments' => array('form' => null),
'render element' => 'form',
'template' => 'templates/form--reset',
);
return $return;
base tpl:
<div class="appointment-container">
<?php print theme('appointment', array('form' => $form));?>
</div>
<div class="reset-button-container">
<?php print theme('reset', array('form' => $reset));?>
</div>
form--reset:
<div class="reset-submit-btn">
<?php print drupal_render($form['submit']);?>
</div>
<i><?php print drupal_render($form['description']);?></i>
<?php
print drupal_render_children($form);
?>
I came across this Render form in template answere here, but I want to manipulate the wrapping html as shown in the reset template.
drupal_get_form
or relevant function that builds the form array (by adding CSRF tokens, etc), you won't see any form tags which I believe is the case here.