Skip to content

Instantly share code, notes, and snippets.

@chrisyue
Created December 12, 2013 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisyue/7922459 to your computer and use it in GitHub Desktop.
Save chrisyue/7922459 to your computer and use it in GitHub Desktop.
symfony sonata admin add default filter
public function getFilterParameters()
{
$default = [
'isAudited' => ['value' => 2],
];
$this->datagridValues = array_merge($default, $this->datagridValues);
return parent::getFilterParameters();
}
@Saracevas
Copy link

Saracevas commented Jul 17, 2018

For those coming from Google, if you want to set the default values for datagrid filters, see this - https://sonata-project.org/bundles/admin/master/doc/reference/action_list.html#default-filters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment