knp paginator 包过滤设置
knp paginator bundle filtration settings
我在 symfony 4 中使用这个包,我的过滤代码如下所示
{{ knp_pagination_filter(paginator, {
't.code': 'Code'
}) }}
还有我的设置文件在
/conf/目录
knp_paginator:
page_range: 5 # default page range used in pagination control
default_options:
page_name: page # page query parameter name
sort_field_name: sort # sort field query parameter name
sort_direction_name: direction # sort direction query parameter name
distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements
filter_field_name: filterField
filter_value_name: filterValue
template:
pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig'
sortable: '@KnpPaginator/Pagination/sortable_link.html.twig' # sort link template
filtration: '@KnpPaginator/Pagination/filtration.html.twig' # filters template
没有人面对这样一个事实,即过滤与过滤器的值紧密相关吗?例如:
并且在筛选字段"Apple"中输入时,基数有值"AppleJuice"和"Apple",我没有看到值"AppleJuice",只有"Apple"
我可以在哪里设置过滤器类型 WHERE '%' + LOWER (param) + '%' LIKE LOWER (item.code)
退出,在您的 table 服务文件中写入您的 SQL 查询
我在 symfony 4 中使用这个包,我的过滤代码如下所示
{{ knp_pagination_filter(paginator, {
't.code': 'Code'
}) }}
还有我的设置文件在 /conf/目录
knp_paginator:
page_range: 5 # default page range used in pagination control
default_options:
page_name: page # page query parameter name
sort_field_name: sort # sort field query parameter name
sort_direction_name: direction # sort direction query parameter name
distinct: true # ensure distinct results, useful when ORM queries are using GROUP BY statements
filter_field_name: filterField
filter_value_name: filterValue
template:
pagination: '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig'
sortable: '@KnpPaginator/Pagination/sortable_link.html.twig' # sort link template
filtration: '@KnpPaginator/Pagination/filtration.html.twig' # filters template
没有人面对这样一个事实,即过滤与过滤器的值紧密相关吗?例如: 并且在筛选字段"Apple"中输入时,基数有值"AppleJuice"和"Apple",我没有看到值"AppleJuice",只有"Apple"
我可以在哪里设置过滤器类型 WHERE '%' + LOWER (param) + '%' LIKE LOWER (item.code)
退出,在您的 table 服务文件中写入您的 SQL 查询