Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I created a custom element called "html". I added Html.php to /Form/Element:</p> <pre> <code> /** Zend_Form_Element_Xhtml */ require_once 'Zend/Form/Element/Xhtml.php'; /** * HTML form element * */ class Zend_Form_Element_Html extends Zend_Form_Element_Xhtml { /** * Default form view helper to use for rendering * @var string */ public $helper = 'formHtml'; } </code> </pre> <p>Second I had to add a view helper FormHtml.php (I put it in application/views/helpers):</p> <pre> <code> /** * Abstract class for extension */ require_once 'Zend/View/Helper/FormElement.php'; /** * Helper to show HTML * */ class Zend_View_Helper_FormHtml extends Zend_View_Helper_FormElement { /** * Helper to show a html in a form * * @param string|array $name If a string, the element name. If an * array, all other parameters are ignored, and the array elements * are extracted in place of added parameters. * * @param mixed $value The element value. * * @param array $attribs Attributes for the element tag. * * @return string The element XHTML. */ public function formHtml($name, $value = null, $attribs = null) { $info = $this->_getInfo($name, $value, $attribs); extract($info); // name, value, attribs, options, listsep, disable // Render the button. $xhtml = 'view->escape($id) . '">' . $this->_htmlAttribs($attribs) . $this->view->escape($value) . ''; return $xhtml; } } </code> </pre> <p>You can then add html to your form as follows:</p> <pre> <code> $form->createElement('html', 'someid', array('value'=>'gna<p>foobar</p>')); </code> </pre> <p>There might be some more simplifications possible.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload