Drupal Form API .
Step 1. Create search form using
Step 2. Register our theme in Drupal theme registry using hook_theme().
Step 3. Create search-form.tpl.phpfile to theme this search form.
function search_form() {
$form['str'] = array(
'#type' => 'textfield',
'#size' => '32',
);
$form['category'] = array(
'#name' => t('category'),
'#type' => 'select',
'#options' => array('0' => t('All'), '1' => t('Bars'), '2' => t('Restaurants')),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Search'),
);
return $form;
}
function search_theme() {
global $theme;
return array(
'search_form' => array(
'arguments' => array('form' => NULL, 'theme' => $theme),
'template' => 'search-form',
),
);
<table cellspacing="0">
<tr>
<td class="container-inline"><strong>php print t('Search');?>strong> php print drupal_render($form['str']); ?>td>
<td class="container-inline"><strong>php print t('Category');?>strong> php print drupal_render($form['category']); ?>td>
<td>php print drupal_render($form['submit']); ?>td>
tr>
table>
<?php
print drupal_render($form);
?>