Zend Framework 2, Doctrine Module 및 SQLServer를 사용하여 여러 제품을 구축하고 있습니다.Zend Framework 2 라디오 버튼 null 값 기본값
Zend \ Form \ Radio와 관련하여 질문이 있습니다.
는 I는 형태로 정의 된 다음 한 :
// boolean $disabled_access
$this->add(array(
'name' => 'disabled_access',
'type' => 'radio',
'options' => array(
'label' => 'Disabled Access',
'value_options' => array('1'=>"Yes", '0' => 'No'),
'allow_empty' => true,
'nullable' => true,
),
'attributes' => array('value' => null),
));
는 그것은 $building entity
에 바인딩됩니다.
DB의 'disabled_access'값을 true
으로 설정하면 라디오 버튼이 올바르게 렌더링됩니다. 마찬가지로 그것은 false
으로 설정됩니다.
그러나 열에 NULL 값이 있으면 라디오 단추의 기본값은 '아니요'입니다. 세 가지 결과를 모두 표시하도록 설정하려면 어떻게해야합니까?
같은 문제가 있습니까? 수정 한 적이 있습니까? –