a5sys / logged-in-redirection-bundle
v1.0.1
2016-02-11 11:02 UTC
This package is auto-updated.
Last update: 2024-09-19 16:47:12 UTC
README
该包将登录用户重定向到指定URL,如果他们尝试访问该URL。
用例
- 用户将登录页面添加为书签,即使已登录也会总是看到登录表单。因此,我们将其重定向到主页。
Composer
使用Composer获取该包
composer require "a5sys/logged-in-redirection-bundle"
激活包
在AppKernel中激活包
public function registerBundles()
{
$bundles = array(
...
new A5sys\LoggedInRedirectionBundle\LoggedInRedirectionBundle(),
配置
您需要将配置添加到您的config.yml文件中
logged_in_redirection:
route_name: "fos_user_security_login" #the name of the route to check
redirect_route_name: "homepage" # the name of the route to redirect