symfony2で独自のフォームタイプを作成していますが、buildView関数で自分のdefaultOptionsにアクセスできません。symfony2カスタムフォームタイプ - own defaultOptions
public function getDefaultOptions(array $options)
{
return array(
'identifier' => isset($options['identifier']) ? $options['identifier'] : '#star',
'currentRating' => isset($options['currentRating']) ? $options['currentRating'] : 0,
);
}
/**
* {@inheritdoc}
*/
public function buildView(FormView $view, FormInterface $form)
{
$view->set('currentRating', $form->getAttribute('currentRating'));
$view->set('idientifier', $form->getAttribute('identifier'));
}
エラー:私はこれが不可能な何かを読んでいない
Notice: Undefined index: currentRating in ...
ここでは、コードです。 ありがとうございます。