lichunqiang / yii2-xmlparser

yii2 request xml parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status version Download Issues

Overview

This is a library help you to handle the xml request. As we all know, Yii2 provided an built-in request parser for json like requests, it's yii\web\JsonParser. Sometimes, we need to handle the request of xml, so this library is birthed.

Install

Add light/yii2-xmlparser to composer.json, you can assign version as *:

$ composer install
//or run
$ composer update

also we can do like this:

$ composer require light/yii2-xmlparser=* --prefer-dist

Usage

# file app/config/main.php [your configuration file]
<?php

return [
    'components' => [
    'request' => [
        'parsers' => [
	        	'text/xml' => 'light\yii2\XmlParser',
	            'application/xml' => 'light\yii2\XmlParser',
	        ],
        ],
    ],
];

Test

$ phpunit

LICENSE

MIT

About

yii2 request xml parser

License:MIT License


Languages

Language:PHP 100.0%