2013-08-26 175 views
1

我正在使用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(); 
    } 
} 

回答

0

你有soanata_user一個錯字。你是否完成SonataUserBundle configuration中列出的步驟?特別是關於路由配置的結尾。

+0

感謝您的回覆,但我解決了這個問題,通過擴展服務和路由覆蓋它。 – Sid