Hello,
I came accross to a post with the following code:
require_once 'Zend/Form/Element/Xhtml.php';
class My_Form_Element_Note extends Zend_Form_Element_Xhtml
{
/**
* Default form view helper to use for rendering
* @var string
*/
public $helper = 'formNote';
}
(I don't know if formNote is meant to be used for that, but you can use your
own view helper)
Then you add the element like that:
$note = new My_Form_Element_Note('note');
$note->setValue('<p>Some notes...</p>');
$note->addDecorators(array(
'ViewHelper',
array('HtmlTag', array('tag' => 'li')) // which ever element you use to
wrap your elements in the form
));
However, I don't understand how to create the view helper.
I've got started with
class Project_View_Helper_CustomHtml
but, where do I extend it and how do I capture the data?
Any ideas much appreciated.
Thanks,
Antonis
--
View this message in context:
http://www.nabble.com/Adding-custom-HTML-to-form-through-View-Helper-tp22245561p22245561.html
Sent from the Zend Framework mailing list archive at Nabble.com.