私はそうのように作成したボタンの要素を持っている:Zend Framework Zend_Formデコレータ:<span>ボタン要素の内側?
$submit = new Zend_Form_Element_Button('submit');
$submit->setLabel('My Button');
$submit->setDecorators(array(
'ViewHelper',
array('HtmlTag', array('tag' => 'li'))
));
$submit->setAttrib('type', 'submit');
これは、次のHTMLを生成:
<li>
<label for="submit" class="optional">My Button</label>
<button name="submit" id="submit" type="submit">My Button</button>
</li>
私は<スパンで、ボタンの内部をラップしたいと思いますが>このように:
<button...><span>My Button</span></button>
Zend_Formを使用してこれを行うには、どのような方法が最適ですか?
非常に詳しい返信をありがとうございます。私はViewScriptデコレータを認識していますが、個々の要素に適用できるかどうかはわかりませんでした。 – leek
これは非常に役に立ちました! – markus