使我在的schema.yml:添加所需的真实,模板
Quest:
columns:
yes_no: { type: boolean, notnull: true }
answer: { type: string(100), notnull: false }
和QuestForm
$this->widgetSchema['yes_no'] = new sfWidgetFormSelectRadio(array('choices' => array(1 => 'yes', 0 => 'no')));
在模板default
我想只渲染在启动这个小部件,但如果用户检查“否”,然后我想呈现小工具答案也与文本框,这必须是required => true
,不为空。 制作它的最佳方法是什么?
当用户选中“无”,形式已经呈现,所以这是来不及说要渲染答案小部件也是如此。 – greg0ire