HTML Helpers

These are a series of helper functions that assist in generating HTML. They are rather simple, and may be of use. You can use this module directly by just importing it, or if you would like it to be available from the template namespace, you should add the bundle’s setup function during application setup phase like so:

from glashammer.bundles.htmlhelpers import setup_htmlhelpers

app.add_setup(setup_htmlhelpers)

The only thing that this does is add a template global variable “h” which is the module, and so the entire API is available.

Bundle cheat-sheet

Template global variables added
‘h’: glashammer.bundles.htmlhelpers

Full API

glashammer.bundles.htmlhelpers

This module provides helpers for the templates but can be useful for the views and modules, too. In the template it’s available as “h”.

copyright:2007 by Armin Ronacher, Glashammer Developers.
license:MIT
glashammer.bundles.htmlhelpers.input_field(name, value='', type='text', **attr)
Render an input field.
glashammer.bundles.htmlhelpers.checkbox(name, checked=False, value='yes', **attr)
Render a checkbox.
glashammer.bundles.htmlhelpers.radio_button(name, value='yes', checked=False, **attr)
Render a radio button.
glashammer.bundles.htmlhelpers.textarea(name, value='', cols=50, rows=10, **attr)
Render a textarea.