Symfony教义管理生成器列表过滤器获取没有csrf令牌的方法

编程入门 行业动态 更新时间:2024-10-18 03:26:49
本文介绍了Symfony教义管理生成器列表过滤器获取没有csrf令牌的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

编辑:解决方案原来是这样的:

public function executeIndex sfWebRequest $ request) { if($ request-> getParameter('first_name')){ $ this-> setFilters(array('first_name'=> $ request- >的getParameter( '如first_name'))); } parent :: executeIndex($ request); }

所以,我刚刚开始使用symfony管理生成器,这很棒。但是,我想知道,我如何使用GET请求过滤列表?例如/ users?name = Simon

如果我尝试:/ users / filter / action / users [name] / Simon

所有我想要做的是创建一个链接列表到另一个。例如在每个用户列表记录中点击查看此用户的帖子将会将您发送到帖子屏幕,但由用户过滤。

如果这样,我不会感到惊讶实际上可以通过generator.yml来完成,但是我不知道如何。

提前感谢您提供的任何帮助。

解决方案

我的答案解释了你所需要的: symfony - 作为链接可访问的管理模块过滤

EDIT: The solution turned out to be along these lines:

public function executeIndex(sfWebRequest $request) { if ($request->getParameter('first_name')) { $this->setFilters(array('first_name' => $request->getParameter('first_name'))); } parent::executeIndex($request); }

Hi,

So, I've just started using symfony admin generator and it's great. But, I want to know, how I can I filter the lists using a GET request? e.g. /users?name=Simon

If I try: /users/filter/action/users[name]/Simon

It complains there is no CSRF token, because usually you filter by using the filter form it generates for you.

All I want to do is create links from one list to the other. e.g. clicking "See this User's Posts" in each user list record will send you to the Posts screen but with it filtered by this user.

I wouldn't be surprised if this could actually be done by the generator.yml but I don't know how, yet.

Thanks in advance for any assistance you can provide.

解决方案

My answer here explains what you need: symfony - admin module filters accessible as links

更多推荐

Symfony教义管理生成器列表过滤器获取没有csrf令牌的方法

本文发布于:2023-11-30 04:27:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1648723.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:令牌   教义   生成器   过滤器   方法

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!