

These are merged with those set via setAttributes().

SetMessageSeparatorString ( string $messageSeparatorString ) Returns the formatted string used to open message representation. $messageOpenFormat – The formatted string to use to open the messages. Set the formatted string used to open message representation. setMessageOpenFormat ( string $messageOpenFormat ) ** * Example #1: Default options */ echo $this -> formElementErrors ( $element ) // Value is required and can' t be empty /** * Example #2: Add attributes to open format */ echo $this -> formElementErrors ( $element, array ( 'class' => 'help-inline' )) // Value is required and can' t be empty /** * Example #3: Custom format */ echo $this -> formElementErrors () -> setMessageOpenFormat ( '' ) -> setMessageSeparatorString ( '' ) -> setMessageCloseString ( '' ) -> render ( $element ) // Value is required and can' t be empty Use Zend\Form\Form use Zend\Form\Element use Zend\InputFilter\InputFilter use Zend\InputFilter\Input // Create a form $form = new Form () $element = new Element\Text ( 'my-text' ) $form -> add ( $element ) // Create a input $input = new Input ( 'my-text' ) $input -> setRequired ( true ) $inputFilter = new InputFilter () $inputFilter -> add ( $input ) $form -> setInputFilter ( $inputFilter ) // Force a failure $form -> setData ( array ()) // Empty data $form -> isValid () // Not valid // Within your view. If null, will default to the $element‘s label. $buttonContent – (optional) The inner content to render.Renders a button’s opening tag, inner content, and closing tag. Renders the open tag for the $element instance. The following public methods are in addition to those inherited from '' // Render the closing tag echo $this -> formButton () -> closeTag () // /** * Example #3: Override the element label */ echo $this -> formButton () -> render ( $element, 'My Content' ) // My Content

*/ echo $this -> formButton ( $element ) // Reset /** * Example #2: Render button in 3 steps */ // Render the opening tag echo $this -> formButton () -> openTag ( $element ) // echo ''. ** * Example #1: Render entire button in one shot. Use Zend\Form\Element $element = new Element\Button ( 'my-button' ) $element -> setLabel ( "Reset" ) // Within your view.
