1
votes

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.

2

2 Answers

1
votes
0
votes

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.