Validating dynamically loaded choices in Symfony 2

后端 未结 5 1334
独厮守ぢ
独厮守ぢ 2020-12-08 16:08

I have a choice field type named *sub_choice* in my form whose choices will be dynamically loaded through AJAX depending on the selected value of the parent choice field, na

5条回答
  •  [愿得一人]
    2020-12-08 16:23

    Suppose for sub choices you have id's right ? Create and empty array with a certain number of values and give it as a choice

    $indexedArray = []; for ($i=0; $i<999; $i++){ $indexedArray[$i]= ''; }

    then 'choices' => $indexedArray, :)

提交回复
热议问题