1

Zend \ Form \ Annotation機能を使用してラジオボタンを作成することは可能ですか?

私は今これを試しています:

/**
 * @Annotation\Type("Zend\Form\Element\Radio")
 * @Annotation\Options({"label":"Status"})
 */
public $status;

しかし、注釈を介してラジオボタンオプションを渡す方法がわかりません。

何か案は?通常のテキスト入力は正常に機能します。

/**
 * @Annotation\Filter({"name":"StringTrim"})
 * @Annotation\Type("Zend\Form\Element\Textarea")
 * @Annotation\Options({"label":"Description"})
 */
public $description;
4

1 に答える 1

2

簡単でした:

/**
 * @Annotation\Type("Zend\Form\Element\Radio")
 * @Annotation\Options({"label":"Status"})
 * @Annotation\Attributes({"options":{"1":"Enabled","2":"Disabled"}})
 * @Annotation\Required(true)
 */
public $status;
于 2013-03-11T12:17:53.137 に答える