承接 nw/json-request-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

nw/json-request-bundle

Composer 安装命令:

composer require nw/json-request-bundle

包简介

Symfony JsonRequest Bundle

README 文档

README

Build Status Scrutinizer Code Quality

JsonRequest Bundle

This bundle is a copy (with some minor changes) of JsonRequest Bundle which, for some reasons, was deleted by authors.

It eases work with JSON requests and treats them as standard requests without using «crutches».

Installation

  1. Require the bundle with composer:
composer require nw/json-request-bundle
  1. Register the bundle in the application: In app/AppKernel.php prior to Symfony version 4.0:
public function registerBundles()
{
    $bundles = [
        // ... ,
        new NW\JsonRequestBundle\NWJsonRequestBundle()
    ];

    // ...
    return $bundles;
}

In config/bundles.php when Symfony version is 4.0 and higher

return [
    //... other bundles
    NW\JsonRequestBundle\NWJsonRequestBundle::class => ['all' => true]
];

Usage

Previously to handle JSON-request, you were forced to do something similar to:

public function indexAction(Request $request)
{
    $data = json_decode($request->getContent(), true);

    // uses request data
    $name = isset($data['name']) ? $data['name'] : null;
}

With this bundle you can work with JSON-request as with standard request:

public function indexAction(Request $request)
{
    $name = $request->get('name');
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固