bobchengbin/yii2-xml-request-parser 问题修复 & 功能扩展

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

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

bobchengbin/yii2-xml-request-parser

最新稳定版本:v0.0.2

Composer 安装命令:

composer require bobchengbin/yii2-xml-request-parser

包简介

Yii2 xml request parser

README 文档

README

Yii2 官方只出了JsonRequestParser,但是没有 XmlRequestParser,所以就创建了这么一个库。

Install

add "bobchengbin/yii2-xml-request-parser": "*" to composer.json's require section

$ composer update

OR

$ composer require bobchengbin/yii2-xml-request-parser '*'

Usage

# file app/config/main.php
<?php

return [
    'components' => [
	'request' => [
	    'parsers' => [
                'application/xml' => [
		    'class' => 'bobchengbin\Yii2XmlRequestParser\XmlRequestParser',
		    'priority' => 'tag', // the default value is 'tag', you can set 'attribute' value
		],
	    ],
        ],
    ],
];

最终测试

然后你可以通过 postman 这种工具往你的应用发送一个 xml 的请求,然后应用那里直接通过 Yii::$app->request->post() 来获取数据。

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 6
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-04