I have created a module with one form in drupal.How i can give theme to the form, means applying css and all
Thanks in advance..
I have created a module with one form in drupal.How i can give theme to the form, means applying css and all
Thanks in advance..
If you want to apply css, you should turn to your theme. Unless you do something very special, you should be fine with just using your theme.
If you want to add a css file, you can use drupal_add_css()
.
If you want to change the markup of your form, you can make a theming function called theme_
+ the name of your form. You can also use $form['#theme']
to set the theming function for the form. In the theming function, you can change the markup as much as you like.
It's generally a good idea to use drupal_render($form)
in the end of your theming function as it will print out what ever in the form that hasn't been rendered manually.
http://data.agaric.com/node/2398 provides example on how to theme a form