2012-04-07 44 views
1

嘿傢伙我有添加文本添加的HTML標籤中的一個問題Zend_Form的裝飾內容

我有這樣的:

public $elementDecorators = array(
    'ViewHelper', 
    'Errors', 
    array('HtmlTag', array('tag' => 'span', 'class' => 'checkbox','description' => 'Club')), 

public function init() { 
    $this->setMethod('post'); 
    //$this->setAttrib('action','index'); 
    $this->addElement('checkbox', 'Club', array(
     'decorators' => $this->elementDecorators, 
    )); 
//omitted code 

,輸出:

<span class="checkbox" markup="Club" description="Club"> 
<input type="hidden" name="Club" value="0"><input type="checkbox" name="Club" id="Club" value="1"></span> 

,我需要什麼do是這樣的:

<span class="checkbox" markup="Club" description="Club">This is club 
<input type="hidden" name="Club" value="0"><input type="checkbox" name="Club" id="Club" value="1"></span> 

我認爲它不應該那麼難,但我無法弄清楚一個簡單/很好的方法來做到這一點。 任何suqqestions?

回答

相關問題