codelytv/criteria-from-url 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codelytv/criteria-from-url

最新稳定版本:0.1.3

Composer 安装命令:

composer require codelytv/criteria-from-url

包简介

README 文档

README

Codely logo

🎼 Criteria from URL

🔒 Read-only repository

Any modification must be done in the main repository.

📥 Installation

composer require codelytv/criteria-from-url

💻 Usage

The criteria converter expect an url with the following format:

  • filters: An array of filters. Composed by:
    • field: The field to filter by.
    • operator: The operator to apply. You can see here the valid operators list.
    • value: The value to filter by.
  • orderBy: The field to order by.
  • order: The order to apply. asc or desc.
  • pageSize: The number of items per page.
  • pageNumber: The page number.

Url examples

Url with one filter and no order or pagination:

http://localhost:3000/api/users?filters[0][field]=name&filters[0][operator]=CONTAINS&filters[0][value]=Javi`

Url with two filter, order and pagination:

http://localhost:3000/api/users
     ?filters[0][field]=name&filters[0][operator]=CONTAINS&filters[0][value]=Javi
     &filters[1][field]=email&filters[1][operator]=CONTAINS&filters[1][value]=gmail
     &orderBy=name
     &order=asc
     &pageSize=10
     &pageNumber=2

Code usage

$url = 'http://localhost:3000/api/users?filters[0][field]=name&filters[0][operator]=CONTAINS&filters[0][value]=Javi';

$converter = new CriteriaFromUrlConverter();

$criteria = $converter->toCriteria($url);

统计信息

  • 总下载量: 2.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-08-05