Created
October 20, 2009 12:15
-
-
Save kentfredric/214214 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Form.tt | |
<!-- the 'form' wrapper is a hookable printer that by default just stuffs in the form, and where the form is going to --> | |
[% WRAPPER form %] | |
<!-- Fields that aren't entirely self-rendering, but parts of the field are --> | |
<!-- note: the 'field' wrapper can theoretically possibly be a callback that allows either | |
generic wrapping of form elements, or specific on a name-by-name basis | |
--> | |
[% WRAPPER field name=email %] | |
<span>[% label %]</span><span>[% field %]</span><span>[% description %]</span> | |
[% END %] | |
<!-- Fields that are entirely self-rendering --> | |
[% password %] | |
[% submit %] | |
[% END %] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Theoretical compiled Pseudocode. | |
$email = '<span>' . $form->email->label->render . '</span><span>' . $form->email->field->render . '</span><span>' . $form->email->description->render . '</span>' ; | |
$email = wrap('field', name => 'email', content => $email); | |
$password = $form->password->render; | |
$submit = $form->submit->render; | |
$body = $email . $password . $submit; | |
$body = wrap('form', content => $body ); | |
return $body; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment