私はたくさんの他のオプションを探そうとしていますが、私が見てきたスタックオーバーフローのような疑問がたくさんありますが、それらはすべてSymfonyやFOSUserBundleの古いバージョンを扱っています... FOSUserBundleのドキュメントでは、プロファイルページにカスタムフィールドを追加する方法、つまり登録ページのみを正確にカバーする方法については説明していません。FOSUserBundle ProfileFormTypeを上書きする方法は? - Symfony 3.1
Userクラスに追加したカスタムフィールドをユーザーのプロフィールページに表示するにはどうすればよいですか?私は他のすべてのスタックオーバーフローの試みを試みました。ここで
は私のservices.ymlです:
services: app.profile.form.type: class: AppBundle\Form\ProfileFormType tags: - { name: form.type, alias: app_user_profile }
は、ここに私のconfig.ymlです:
fos_user: profile: form: type: AppBundle\Form\ProfileFormType
そして、私のプロフィールクラスの多くのただ一回の反復: <?php namespace AppBundle\Form\Type;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface;
class ProfileFormType extends AbstractType { public function buildUserForm(FormBuilderInterface $builder, array $options) { $builder->add('pokemon'); }
public function getParent()
{
return 'FOS\UserBundle\Form\Type\ProfileFormType';
}
public function getBlockPrefix()
{
return 'app_user_profile';
}
// For Symfony 2.x
public function getName()
{
return $this->getBlockPrefix();
}
} `
作成されていることを確認してください:( –