Php Symfony with easyadmin-主页被重定向到管理页面
通过遵循本教程,我将Symfony 5.0.4与easyadmin一起使用。 安装easyadmin后,我尝试获取我的主页。 但它会重定向到/admin。 默认情况下设置所有配置文件Php Symfony with easyadmin-主页被重定向到管理页面,php,symfony,easyadmin,Php,Symfony,Easyadmin,通过遵循本教程,我将Symfony 5.0.4与easyadmin一起使用。 安装easyadmin后,我尝试获取我的主页。 但它会重定向到/admin。 默认情况下设置所有配置文件 如何在不重定向的情况下加载主页?您应该更新config\packages\easy\u admin.yaml文件,并在菜单中添加指向主页的链接: easy\u管理: 设计: 菜单: -{路线:“主页”,标签:“返回网站”,图标:“主页”} 不要忘记用路线页面的路线名称替换“主页”。 您可以按类型查找到主页的路径
如何在不重定向的情况下加载主页?您应该更新
config\packages\easy\u admin.yaml
文件,并在菜单中添加指向主页的链接:
easy\u管理:
设计:
菜单:
-{路线:“主页”,标签:“返回网站”,图标:“主页”}
不要忘记用路线页面的路线名称替换“主页”。
您可以按类型查找到主页的路径:
symfony console debug:route
PS:如果debug:route命令未知,则应安装调试包:
symfony composer req debug --dev
然后,您必须在代码中搜索与主页路径对应的控制器。
以下是一个例子:
class DefaultController extends AbstractController
{
/**
* @Route("/", name="homepage") <== This is the method called when I wand to display the homepage
*/
public function index(): Response
{
return new Response('This is an example');
}
}
You should find the method called in your application and verify its code to find why it redirects you to the easyadmin route.
class DefaultController扩展了AbstractController
{
/**
*@Route(“/”,name=“homepage”)您应该更新config\packages\easy\u admin.yaml
文件,并在菜单中添加指向主页的链接:
easy\u管理:
设计:
菜单:
-{路线:“主页”,标签:“返回网站”,图标:“主页”}
不要忘记用路线页面的路线名称替换“主页”。
您可以按类型查找到主页的路径:
symfony console debug:route
PS:如果debug:route命令未知,则应安装调试包:
symfony composer req debug --dev
然后,您必须在代码中搜索与主页路径对应的控制器。
以下是一个例子:
class DefaultController extends AbstractController
{
/**
* @Route("/", name="homepage") <== This is the method called when I wand to display the homepage
*/
public function index(): Response
{
return new Response('This is an example');
}
}
You should find the method called in your application and verify its code to find why it redirects you to the easyadmin route.
class DefaultController扩展了AbstractController
{
/**
*@Route(“/”,name=“homepage”)非常感谢你,Alexandre
问题出在全球航线上,我不知道为什么
例如:
#
/**
*@Route(“/”,name=“实验室”)
*/
类IndexController扩展了AbstractController
{
#
当我移动路线时,所有主页都开始工作。非常感谢你,Alexandre
问题出在全球航线上,我不知道为什么
例如:
#
/**
*@Route(“/”,name=“实验室”)
*/
类IndexController扩展了AbstractController
{
#
当我在所有主页内移动路线时,主页开始工作。默认情况下easyadmin使用路径/admin,您可以在easy_admin.yaml上更改此选项,默认情况下easyadmin使用路径/admin,您可以在easy_admin.yaml上更改此选项,