Skip to content

jamguoxiaoqi/yii2-xmlparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2 XML Parser


An XML request parser just like built-in yii\web\JsonParser.

Installation

The preferred way to install this extension is through composer:

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

or

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

Usage

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

<?php

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

and then:

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

License

License