2014-04-03 2 views
1

몇 가지 기능을 추가하려면 FOSUserBundle의 ProfileController을 재정의해야합니다.FOSUserBundle에서 ProfileController를 재정의하는 방법

컨트롤러를 어떻게 무시할 수 있습니까?

class MyBundle extends Bundle 
{ 
    public function getParent() 
    { 
     return 'FOSUserBundle'; 
    } 
} 

을 그리고 같은 이름을 가진 컨트롤러를 만들 :

+0

답변은 다음 링크에 있습니다. http : //stackoverflow.com/questions/21094367/fosuserbundle-override-action-of-a-controller – razzek

+0

다음 링크 참조 : http : //stackoverflow.com/questions/21094367/ fosuserbundle-override-of-a-controller – razzek

답변

1

그냥 번들 자체를 확장 할 수 있습니다. 물론 이것은 Symfony2 관련 용어 인 MyBundle:Controller:myAction을 사용할 때만 작동합니다.

+0

나는 그것을 수행하고 formregistration을 오버라이드하고 컨트롤러 프로파일을 만들지 만, 테스트를 위해 echo하지만 결과는 나타나지 않는다. – razzek

+0

http://symfony.com/doc/ current/cookbook/bundles/override.html –

+0

다음과 같이 추가하면 프로파일 컨트롤러가 무시됩니다. $ em = $ this-> getDoctrine() -> getManager(); $ notif = $ em1-> getRepository ('PublishDemandsBundle : Notification') -> findBy (array ('seen'=> false, 'typeevent'=> demande)); 오류 : 정의되지 않은 메소드 호출 Register \ UserBundle \ Controller \ ProfileController :: getDoctrine() – razzek

관련 문제