EasyAdmin 4-用过滤器生成URL
我需要将用户重定向到CRUD索引,其中应用“ status = Active”的过滤器索引。
我已经这样做了:
$url = $this->adminUrlGenerator
->setController(Customer::class)
->generateUrl();
return $this->redirect($url);
但是我找不到向其添加过滤器的方法。我尝试搜索类似的东西:
->setFilter('Status', 'ACTIVE')
但是没有运气。文档中没有什么。怎么做?
I need to redirect my user to CRUD index where filter "STATUS = ACTIVE" is applied.
I've this:
$url = $this->adminUrlGenerator
->setController(Customer::class)
->generateUrl();
return $this->redirect($url);
But I can't find a way to add a filter to it. I've tried searching for something like:
->setFilter('Status', 'ACTIVE')
but without any luck. There is nothing in the docs. How to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
easyAdmin通过添加多个选项来处理每个过滤器案例,将easyAdmin处理过滤器。
value
与value2 等...
通过状态过滤
活动
会用因此,使用EA Adminurlgenerator时,您可以使用
- > set
修改选项。您会得到:
我将案例保留在 s tatus上,但是如果您的财产处于小写状态,请在此处进行。
EasyAdmin handle filters in your url by adding multiple options to handle each filters case.
value
to be compared withvalue2
(Example: between value and value2)comparison
for "equal", "less than", "greater than" etc...Filtering by Status
ACTIVE
would modify your url withSo when using EA AdminUrlGenerator, you can use
->set
to modify options.You would get:
I kept the case on Status, but if your property is in lowercase, do it here as well.