문제

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

다른 팁

I have tried embedding the filter form of the "target" table in the main table from which you would like to be redirected hidding everything but the filter button. As you have mentioned it does not always work without the token.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top