I'm not sure what you want to do. But if you define public $helper =
'formNote' you should make something like:

class Zend_View_Helper_FormNote extends Zend_View_Helper_FormElement {
  public function formNote($name, $value = null, $attribs = null)
  {
     ... bla bla bla
    return ...  
  }
}

let us know if this helped you on the way


antonis wrote:
> 
> 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
> 


-----
visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Adding-custom-HTML-to-form-through-View-Helper-tp22245561p22249464.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to