I've gone back and forth on the idea of using ALL html generation functions to hammering it all out in a template like Smarty. Templates are nice, It sure is nice to use functions. I was looking at RoR and saw these HTML helper functions. I thought, hey I can write them in php. (Yeah to all you php hating ruby folks, this may be an effort in futility, but thinking how to implement some of these things in PHP helps me understand the concept, like my MVC articles).
Her examples include the creation of text fields, text areas, and opening/closing tags for a form. The two field functions also take in values and attributes to specify in the outputed HTML.