0

このhttps://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.2.0/Resources/doc/overriding_forms.mdを使用してカスタム登録フォームを作成しようとしています

私は最後まですべてをフォローしていますが、次のエラーが発生します:

    ParseException: Unable to parse in "\/home\/shokora\/git\/extrastufi\/src\/ExtraStufi\/DatabaseBundle\/DependencyInjection\/..  \/Resources\/config\/services.yml" at line 10 (near " arguments: [%fos_user.model.user.class%]").


in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/Yaml/Parser.php line 227
at Parser->parse() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/Yaml/Parser.php line 168
at Parser->parse() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/Yaml/Parser.php line 168
at Parser->parse() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/Yaml/Yaml.php line 73
at Yaml::parse() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php line 242
at YamlFileLoader->loadFile() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php line 42
at YamlFileLoader->load() in /home/shokora/git/extrastufi/src/ExtraStufi/DatabaseBundle/DependencyInjection/ExtraStufiDatabaseExtension.php line 26
at ExtraStufiDatabaseExtension->load() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 42
at MergeExtensionConfigurationPass->process() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 119
at Compiler->compile() in /home/shokora/git/extrastufi/vendor/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 437
at ContainerBuilder->compile() in /home/shokora/git/extrastufi/app/bootstrap.php.cache line 872
at Kernel->buildContainer() in /home/shokora/git/extrastufi/app/bootstrap.php.cache line 783
at Kernel->initializeContainer() in /home/shokora/git/extrastufi/app/bootstrap.php.cache line 517
at Kernel->boot() in /home/shokora/git/extrastufi/app/bootstrap.php.cache line 548
at Kernel->handle() in /home/shokora/git/extrastufi/web/app_dev.php line 27

services.ymlのコードは

parameters:
#    extra_stufi_database.example.class: ExtraStufi\DatabaseBundle\Example

services:
#    extra_stufi_database.example:
#        class: %extra_stufi_database.example.class%
#        arguments: [@service_id, "plain_value", %parameter%]
    extra_stufi_database.registration.form.type:
        class: ExtraStufi\DatabaseBundle\Form\Type\RegistrationFormType
            arguments: [%fos_user.model.user.class%]
            tags:
                - { name: form.type, alias: student_user_registration }

(これをすぐに含めなかったのは残念です。オフィスでの最後の10分間でした:P)。

4

3 に答える 3

0

このエラーは、構文エラーがあることを示しています

/home/shokora/git/extrastufi/src/ExtraStufi/DatabaseBundle/DependencyInjection/ .. /Resources/config/services.yml

10行目のファイル。このファイルの内容を投稿していただけますか?

于 2012-07-31T16:24:10.587 に答える
0

わかりました。https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.2.0/Resources/doc/overriding_forms.mdに記載されているXMLバージョンのservices.yml(services.xml)を使用して修正しました。

services.ymlの何が問題だったのかはまだわかりませんが、これは機能します。

于 2012-08-01T09:10:04.980 に答える
0

FileLoaderをYamlで変更します:

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
于 2013-12-19T13:53:14.213 に答える