定制 haskel/request-param-bind-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

haskel/request-param-bind-bundle

Composer 安装命令:

composer require haskel/request-param-bind-bundle

包简介

Converts HTTP request to DTO

关键字:

README 文档

README

name=John&surname=Smith

class Controller 
{

    public function getPerson(#[FromQuery] string $name, #[FromQuery] string $surname)
    {
        //...
    }
}

name=John&surname=Smith&middleName=Dude

class Person 
{
    public ?string $name;
    public ?string $surname;
    public ?string $middleName;
}

class Controller 
{

    public function getPerson(#[FromQuery] Person $person)
    {
        //...
    }
}

filter[price][from]=10&filter[price][to]=300

class Filter 
{
    public ?PriceRange $price;
}

class PriceRange 
{
    public ?float $from;
    public ?float $to;
}

class Controller 
{

    public function filter(#[FromQuery] Filter $filter)
    {
        //...
    }
}

page=3&itemsPerPage=100&filter[price][from]=10&filter[price][to]=300

class Filter 
{
    public ?PriceRange $price;
}

class PriceRange 
{
    public ?float $from;
    public ?float $to;
}

class Pagination 
{
    public int $page = 1;
    public int $itemsPerPage = 10;
}

class Controller 
{

    public function filter(#[FromQuery] Filter $filter, #[FromQuery] Pagination $pagination)
    {
        //...
    }
}

filter[name][0]=location&filter[value][0]=California&filter[name][1]=maxPrice&filter[value][1]=300

class Filter 
{
    public string $name;
    public $value;
}

class Controller 
{

    public function filter(#[FromQuery] Filter ...$filters)
    {
        //...
    }
}

Body

same as Query

Header

Cookie

File

Name Converter

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固