Drupal 7 - Form in a Block With Template File

I have been coming up against the same Drupal 7 requirement over and over recently - the need to have a form in a block with a separate template file I can pass over to the front-end guy to weave his magic. This is one of my easiest ever tutorials, and is really only here as an aide memoire for when I can't quite remember the exact syntax in say hook_theme or I can't remember which rendering functions I call in the template.

By using the module below, you have an excellent boilerplate to start your FAPI coding since this pattern repeats (as I have noted) over and over! Too easy!

fb_pattern.info

name = Form / Block Patterndescription = Boilerplate form in a block pattern code with template filecore = 7.x

fb_pattern.module

<?php/** File : fb_pattern.module* Title : Drupal 7 Boilerplate form in a block pattern with template file* Author : <a href="http://www.badzilla.co.uk" title="www.badzilla.co.uk">www.badzilla.co.uk</a> @badzillacouk** This work is copyright BadZilla under the GPL licence terms and conditions**/