-
Notifications
You must be signed in to change notification settings - Fork 3
Form Tales
The Form tales are mainly used within the ZTal form macros to support rendering Zend_Form objects. However, they are available if you wish to replace some or all of the form macros with your own template code.
All the form tales are used in the form Ztal\Tales\Form.
followed by the name of the tale - see the examples for more info.
Fetch a named attribute from the supplied Zend_Form_Element
<input tal:attributes="maxlength Ztal\Tales\Form.getAttrib:element,attribute" />
Fetch a named element from the supplied Zend_Form
<tal:block tal:define="element Ztal\Tales\Form.getElement:element,name" />
Fetch the errors for a named element from the supplied Zend_Form
<tal:block tal:define="element Ztal\Tales\Form.getErrors:form,elementName" />
Determine the input field type for a Zend_Form_Element
<input tal:attributes="type Ztal\Tales\Form.inputType:element" />
Determine whether the current element is actually a display group
<fieldset tal:condition="Ztal\Tales\Form.isDisplayGroup:element"></fieldset>
Determine whether the current element is a standard element such as input or select.
<input tal:condition="Ztal\Tales\Form.isFormElement:element" />
Determine whether the current element is a hidden element.
<input tal:condition="Ztal\Tales\Form.isHiddenElement:element" />
Determine whether the current element is a button element.
<button tal:condition="Ztal\Tales\Form.isButton:element" />
Determine whether the current element is an image captcha
<span tal:condition="Ztal\Tales\Form.isImageCaptcha:element" />
Determine whether the current element is an non-image captcha
<span tal:condition="Ztal\Tales\Form.isCaptcha:element" />
Determine whether the current option in a multiCheckbox should be checked.
<tal:block tal:define="checked Ztal\Tales\Form.isChecked:element,currentOption" />
Determine whether the current element is disabled.
<tal:block tal:attributes="disabled Ztal\Tales\Form.isDisabled:element" />
Determine whether the current element is an input element.
<input tal:condition="Ztal\Tales\Form.isInput:element" />
Determine whether the current element is a multiCheckbox element.
<input tal:condition="Ztal\Tales\Form.isMultiCheckbox:element" />
Determine whether the current element is a radio element.
<input tal:condition="Ztal\Tales\Form.isRadio:element" />
Determine whether the current element is a checkbox element.
<input tal:condition="Ztal\Tales\Form.isCheckbox:element" />
Determine whether the current element is a select element.
<input tal:condition="Ztal\Tales\Form.isSelect:element" />
Determine whether the current element is a multiSelect element.
<input tal:condition="Ztal\Tales\Form.isMultiSelect:element" />
Determine whether the current element is a textarea element.
<textarea tal:condition="Ztal\Tales\Form.isTextarea:element" />
Determine whether to show the label before the element.
<label tal:condition="Ztal\Tales\Form.showLabelBefore:element" />
Determine whether to show the label after the element.
<label tal:condition="Ztal\Tales\Form.showLabelAfter:element" />
Fetch content for a possible slot of the supplied name (that does not need to exist)
<tal:block tal:define="slotContent Ztal\Tales\Form.getSlotContent:slotName" />