2014-05-20 36 views
-1

下面給出我的security.yml文件。因爲我需要提供「黃昏」作爲一個段落。在security.yml中爲symfony2.3提供login_path參數

防火牆:

frontend: 
     pattern: /twilight/backend/.* 
     provider: fos_userbundle 
     anonymous: ~   
     form_login: 
      check_path: /twilight/backend/login_check 
      login_path: /twilight/backend/signin 
      username_parameter: _username 
      password_parameter: _password 
      csrf_parameter: _csrf_token 
      intention: authenticate    
      post_only: true 
      remember_me: true 
      #use_referer: true 
      always_use_default_target_path: true 
      default_target_path: /twilight/backend/securepage 

有人請幫助...

回答

2

在您parameters.yml(或者您包括或已經加載任何配置文件)設置:

custom_path: "/twilight" 

並從security.yml文件中獲取custom_path變量:

check_path: %custom_path%/backend/login_check