Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jamguoxiaoqi/yii2-xmlparser

Yii2 XML request parser
https://github.com/jamguoxiaoqi/yii2-xmlparser

parse parser request xml xml-parser yii yii2 yiiframework

Last synced: 26 days ago
JSON representation

Yii2 XML request parser

Awesome Lists containing this project

README

        





Yii2 XML Parser



An XML request parser just like built-in [yii\web\JsonParser](https://www.yiiframework.com/doc/api/2.0/yii-web-jsonparser).

Installation
------------

The preferred way to install this extension is through [composer](http://getcomposer.org/download/):

```
composer require --prefer-dist jamguozhijun/yii2-xmlparser
```

or

```
php composer.phar require --prefer-dist jamguozhijun/yii2-xmlparser
```

Usage
-----

```php
# app/config/main.php (your configuration file)

[
'request' => [
'parsers' => [
'application/xml' => 'jamguozhijun\yii\web\XmlParser',
'text/xml' => 'jamguozhijun\yii\web\XmlParser',
]
],
],
];
```

and then:

```php
Yii::$app->request->post();
```

License
-------

![License](https://img.shields.io/github/license/jamguozhijun/yii2-xmlparser)