$sfKeyword = new Zend_Form_SubForm();
// text field
$tfKeyword = $sfKeyword->createElement('text', 'keyword');
$tfKeyword->setLabel('Search Keyword:');
// add elements
$sfKeyword->addElement($tfKeyword);
$sfKeyword->addElement('submit', 'submitSqlKeywordCheckerForm', array('label' => 'Check'));
// prepend labels
$sfKeyword->setElementDecorators(array(
'ViewHelper',
'Errors',
array('Label', array('placement' => 'prepend')),
));
次のようなGUIを表示したい
[textfield label] [textfield] [submit button]
ただし、次のように表示されます。
[textfield label] [textfield] [submit button label] [submit button]
上記のコードの問題は、送信ボタンにはボタンで使用されるラベルが必要ですが、デコレータで回避できないラベルをボタンの左側に表示したくないということです。
array('Label', array('placement' => 'prepend')),
基本的に2つのオプションがあります。
送信ボタンのテキストラベル(ボタン内のラベルではない)を抑制しますまたは
ラベルデコレータを削除し、テキストフィールドの前に手動で簡単なテキストを追加します
非表示の入力なしでフォームに単純なテキストを追加する方法がわかりません。入力はラベル付けする必要があるため、どちらも役に立ちません。
どうすればいいのですか?ありがとう