Hi, i need to generate complex html in some viewHelpers.
Now i am using heredoc notation but i am looking for a best solution.
Some tips?
Here is an example of a viewHelper i am using:
<?php
class Zend_View_Helper_EditorPagineTesti extends Zend_View_Helper_Abstract {
public function editorPagineTesti($elemento) {
$id_elemento = $elemento->getIdForEditor();
$textArea = $this->view->formTextarea('textarea_'.$id_elemento,
$elemento->testo, array('style' => 'width: 910px;',
'class'=>'tinymce'));
$html = <<<HTML
<div style="display: none;" id="editor_$id_elemento">
$textArea
<button
onclick="salvaModifiche('$id_elemento');">Salva</button>
<button
onclick="annullaModifiche('$id_elemento');">Annulla</button>
</div>
HTML;
return $html;
}
}