如何自动填充包含实体选项的表单?我正在尝试制作一个更新详细信息表单,该表单在调用时已经包含该用户信息。
我正在使用 Symphony 2.1。
表格如下所示:
$builder
//->add('createdate')
//->add('modifydate')
->add('schoolname')
->add('schoolprofile')
->add('streetaddress')
->add('streetaddressext')
->add('country', 'entity', array(
'class' => 'IFS\Account\RegisterSchoolBundle\Entity\Country',
'property' => 'countryname',
))
->add('schoolprogramid', 'entity', array(
'class' => 'IFS\Account\RegisterSchoolBundle\Entity\Schoolprogram',
'property' => 'displayname',
))
->add('schoolsizegroupid', 'entity', array(
'class' => 'IFS\Account\RegisterSchoolBundle\Entity\Schoolsizegroup',
'property' => 'displayname',
))
->add('state', 'entity', array(
'class' => 'IFS\Account\RegisterSchoolBundle\Entity\State',
'property' => 'statename',
))
->add('city', 'entity', array(
'class' => 'IFS\Account\RegisterSchoolBundle\Entity\City',
'property' => 'cityname',
))
;
}