0
隨着Symfony的,我有從實體無線電形式:Symfony的:獲取實體radio_widget
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('color', EntityType::class, [
'class' => Color::class,
'expanded' => true,
'label_attr' => [
'class' => 'radio-inline'
],
'label' => 'label.color',
....
但是,當我轉儲()在radio_widget
,我沒有實體:
array:28 [▼
"value" => "1"
"attr" => []
"form" => FormView {#975 ▶}
"id" => "news_category_versions_0_color_1"
"name" => "1"
"full_name" => "news_category[versions][0][color]"
"disabled" => false
"label" => "Blue"
"label_format" => null
"multipart" => false
"block_prefixes" => array:4 [▶]
"unique_block_prefix" => "_news_category_versions_entry_color_entry"
"translation_domain" => false
"cache_key" => "_news_category_versions_entry_color_entry_radio"
"errors" => FormErrorIterator {#1186 ▶}
"valid" => true
"data" => false
"required" => true
"size" => null
"label_attr" => []
"compound" => false
"method" => "POST"
"action" => ""
"submitted" => false
"help_translation_domain" => null
"checked" => false
"parent_label_class" => "radio-inline"
"app" => AppVariable {#1216 ▶}
]
我可以在radio_widget
中獲得實體嗎?每個收音機都有一個特定的顏色(藍色,紅色,綠色等)。