FOSUserBundle翻译路线名称

时间:2016-03-23 16:42:11

标签: symfony fosuserbundle sonata-user-bundle

您好我正在使用带有SonataUserBundle的FOSUserBundle路由。哪个是英文的。 我想用法语翻译它们。

我做了routing.yml

sonata_user_resetting:
    resource: "@SonataUserBundle/Resources/config/routing/sonata_resetting_1.xml"
    prefix: /reset

sonata_user_profile:
    resource: "@SonataUserBundle/Resources/config/routing/sonata_profile_1.xml"
    prefix: /mon-compte

sonata_user_register:
    resource: "@SonataUserBundle/Resources/config/routing/sonata_registration_1.xml"
    prefix: /inscription

sonata_user_change_password:
    resource: "@SonataUserBundle/Resources/config/routing/sonata_change_password_1.xml"
    prefix: /mon-compte

sonata_user:
    resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
    prefix: /admin

sonata_user_admin_security:
    resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
    prefix: /admin

sonata_user_admin_resetting:
    resource: '@SonataUserBundle/Resources/config/routing/sonata_resetting_1.xml' # et non 'admin_resetting.xml' : erreur dans la doc
    prefix: /admin/reset

但是我没有看到我可以在哪里配置/ login路由。

你有个主意吗?

编辑:

我的AppKernel.php

$bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new FM\AppBundle\AppBundle(),
            new FOS\UserBundle\FOSUserBundle(),
            // These are the other bundles the SonataAdminBundle relies on
            new Sonata\CoreBundle\SonataCoreBundle(),
            new Sonata\BlockBundle\SonataBlockBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            // Storage and SonataAdminBundle
            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
            new Sonata\AdminBundle\SonataAdminBundle(),
            new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
            new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
            new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),
        );

Application\Sonata\UserBundle\ApplicationSonataUserBundle是托管我的用户实体的Bundle。

1 个答案:

答案 0 :(得分:0)

登录路线在FOS/UserBundle/Resources/config/routing/security.xml中定义。

示例代码更改:

fos_user_security_login:
    path:      /yourpath/login
    defaults:  { _controller: FOSUserBundle:Security:login, _method: POST }

在此处阅读有关覆盖FOSUserBundle路线的更多信息:http://symfony.com/doc/current/bundles/FOSUserBundle/routing.html