をロードできませんでした、(私はバンドルを上書きするためのマニュアルの指示に従ったが、私は/レジスタの中に/ログイン作品にアクセスしようとしたとき、私はこのエラーを取得するI )それを上書きしませんでした:FOSUserBundleが登録を上書きしますが、私はFOSUserBundleを使用しようとしたタイプのエラー
Could not load type "app_user_registration"
500 Internal Server Error - InvalidArgumentException
構成
symfonyのバージョン:3.1.7
FOSUserBundleバージョン:DEV-マスター
マイファイル/設定/ services.yml
アプリ:
services:
app.form.registration:
class: CoreBundle\Form\Type\RegistrationFormType
tags:
- { name: form.type, alias: app_user_registration }
アプリ/設定/ config.yml:
fos_user:
db_driver: orm
firewall_name: main
user_class: CoreBundle\Entity\User
registration:
form:
type: app_user_registration
のsrc/CoreBundle /Form/Type/RegistrationFormType.php
<?php
// src/CoreBundle/Form/Type/RegistrationFormType.php
namespace CoreBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class RegistrationFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('name');
}
public function getParent()
{
return 'fos_user_registration';
}
public function getName()
{
return 'app_user_registration';
}
}
?>
のsrc/viwa/UserBundle /コントローラー/ RegistrationController.php:
<?php
// src/viwa/UserBundle/Controller/RegistrationController.php
namespace viwa\UserBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use FOS\UserBundle\Controller\RegistrationController as BaseController;
class RegistrationController extends BaseController
{
// Don't need to change this right now.
}
?>
のsrc/viwa/UserBundle/viwaUserBundle.php:あなたが私に私を助けるために他の何かを必要とする場合
<?php
// src/viwa/UserBundle/viwaUserBundle.php
namespace viwa\UserBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class viwaUserBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}
私の投稿を編集する。
は、誰もが私を助けることができます願っています。
、代わりにエイリアスapp_user_resitrationを使用しての、CoreBundle \フォーム\タイプ\ RegistrationFormTypeを使用しています。 CoreBundle/Form/Type/RegistrationFormTypeのgetParent()は、 '' FOS \ UserBundle \ Form \ Type \ RegistrationFormType 'を返します。もっと見ることがあれば、もう一度コメントします – pogeybait