2
나는 2.1 Symfony2 업데이트 내가 양식을 제출하려고 할 때 나는 오류가 점점 오전 : 폼 타입 클래스초이스 제약은 유효한 콜백에게 기대
The Choice constraint expects a valid callback
소스 코드 :
$builder->add('type', 'choice',
array(
'expanded' => true,
'multiple' => false,
'choice_list' => new TypeChoices(),
'required' => true,
)
)
TypeChoices 클래스를 :
class TypeChoices implements ChoiceListInterface {
public static $choices = array(
'full-time' => 'Full time',
'part-time' => 'Part time',
'freelance' => 'Freelance',
);
public static function getChoiceNameByValue($value)
{
return self::$choices[$value];
}
public function getChoices()
{
return self::$choices;
}
public static function getTypeChoicesKeys()
{
return array_keys(self::$choices);
}
public static function getPreferredChoiceKey()
{
return 'full-time';
}
}
누군가 나에게 조언을 제공 할 수 있습니까?
구현 '변한 것으로 보인다. ['upgrade-2.1.md'] (https://github.com/symfony/symfony/blob/master/UPGRADE-2.1.md#other-bc-breaks)를 보았습니까? – gilden