Я использую symfony2.3.X и комплект для подключения sonata с пакетом fos. Вся установка успешно завершена с помощью предоставленной документации. Но когда я продлить сонатную профиль пользователя и хотите редактировать, то покажите мне ошибку:Ни один из цепных маршрутизаторов не смог сгенерировать маршрут: Маршрут
None of the chained routers were able to generate route: Route 'sonata_user_profile_visit' not found
Я не знаю, почему? Это проблема стабильности версии пакета сторонних поставщиков? Или моя проблема с конфигурацией?
composer.json
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "~2.3",
"symfony-cmf/routing-bundle": "1.1.*@dev",
"symfony-cmf/routing": "1.1.*@dev",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-fixtures-bundle": "2.1.*@dev",
"doctrine/data-fixtures": "1.0.*@dev",
"twig/extensions": "1.0.*",
"twig/twig": "~1.12",
"jms/security-extra-bundle": "~1.5",
"jms/di-extra-bundle": "~1.4",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"knplabs/gaufrette": "0.1.4",
"knplabs/knp-menu-bundle": "1.1.x-dev",
"knplabs/knp-markdown-bundle": "1.2.*@dev",
"sonata-project/easy-extends-bundle": "~2.1",
"sonata-project/seo-bundle": "~1",
"sonata-project/doctrine-extensions": "~1",
"sonata-project/intl-bundle": "~2.1",
"sonata-project/doctrine-orm-admin-bundle": "2.2.*@dev",
"sonata-project/notification-bundle": "~2.2",
"sonata-project/block-bundle": "~2.2",
"sonata-project/media-bundle": "2.2.*@dev",
"sonata-project/user-bundle": "2.2.*@dev",
"sonata-project/cache-bundle": "~2.1",
"sonata-project/page-bundle": "~2.3",
"sonata-project/formatter-bundle": "~2.3",
"sonata-project/news-bundle": "~2.3",
"friendsofsymfony/facebook-bundle": "*",
"friendsofsymfony/user-bundle": "1.3.*",
"dflydev/markdown": "~1.0",
"simplethings/entity-audit-bundle": "~0.5",
"willdurand/faker-bundle": "~1.0",
"incenteev/composer-parameter-handler": "~2.0",
"sonata-project/admin-bundle": "master"
},
routing.yml
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix:/
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /{username}
fos_user_group:
resource: "@FOSUserBundle/Resources/config/routing/group.xml"
prefix: /group
admin:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin
soanata_user:
resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
prefix: /admin
soanata_user:
resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
prefix: /admin
профиль контроллер
<?php
namespace XXX\UserBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Sonata\UserBundle\Controller\ProfileController as BaseController;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use FOS\UserBundle\Model\UserInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use FOS\UserBundle\FOSUserEvents;
class ProfileController extends BaseController
{
public function editAction()
{
return parent::editAction();
}
}
Спасибо за ответ, но я решу эту проблему, расширяя службы и перенаправляя маршрут. – Sid