Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony1 如何让所有用户在登录Symfony时路由到一个模块和一个操作?_Symfony1 - Fatal编程技术网

Symfony1 如何让所有用户在登录Symfony时路由到一个模块和一个操作?

Symfony1 如何让所有用户在登录Symfony时路由到一个模块和一个操作?,symfony1,Symfony1,这是我的另一篇文章的后续内容 我需要这样做,当任何人登录时,他们都会被重定向到一个特定的模块-sfGuardUser和actionisExistingUser。我知道这与路由有关,但我对这个文件一无所知,我无法理解它的头绪,而且在线教程对我来说没有任何意义 问题更加复杂(我认为),因为如果有人注销(单击链接注销),他们在浏览器中的url不会改变,因此如果他们从同一屏幕登录,symfony会尝试将他们带到浏览器中已有的任何url。我不知道如何在我的路线中说明这一点 我有两个应用程序-前端和后端。我

这是我的另一篇文章的后续内容

我需要这样做,当任何人登录时,他们都会被重定向到一个特定的模块-sfGuardUser和actionisExistingUser。我知道这与路由有关,但我对这个文件一无所知,我无法理解它的头绪,而且在线教程对我来说没有任何意义

问题更加复杂(我认为),因为如果有人注销(单击链接注销),他们在浏览器中的url不会改变,因此如果他们从同一屏幕登录,symfony会尝试将他们带到浏览器中已有的任何url。我不知道如何在我的路线中说明这一点

我有两个应用程序-前端和后端。我认为用户是从前端登录的(老实说,我不确定),但我认为这是前端,因为当他们登录时,他们会被带到前端应用程序中的一个模块。尽管查看了这两个应用程序的settings.yml,但登录模块已为这两个应用程序启用:S

这是我的前端路由文件:

   homepage:
     url:   /
     param: { module: investigation, action: isExistingUser }

   default_index:
     url:   /:module
     param: { module: investigation, action: isExistingUser }

   default:
     url:   /:module/:action/*
     param: { module: investigation, action: isExistingUser }
以及后端:

homepage:
   url:   /
   param: { module: sfGuardUser, action: index }

sfGuardUser:
   url:   /sf_guard_user
   param: { module: sfGuardUser, action: index }

default_index:
   url:   /:module
   param: { action: index }

default:
   url:   /:module/:action/*

在app.yml中为每个项目设置登录或注销后使用的路线

例如,在apps/(后端|前端)/config/app.yml中:

all:
  sf_guard_plugin:
    success_signin_url:      @my_route?param=value # the plugin use the referer as default
    success_signout_url:     module/action         # the plugin use the referer as default
可在sfguardplugin;的额外文档中找到)