bestyii / yii2-xmlparser
yii2 xml request parser
v1.0.0
2022-09-21 07:21 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: 2.0.*
Requires (Dev)
- phpunit/phpunit: 4.4.*
This package is not auto-updated.
Last update: 2024-11-14 15:37:11 UTC
README
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 bestyii/yii2-xmlparser
to composer.json, you can assign version as *
:
$ composer install //or run $ composer update
also we can do like this:
$ composer require bestyii/yii2-xmlparser --prefer-dist
Usage
# file app/config/main.php [your configuration file]
<?php
return [
'components' => [
'request' => [
'parsers' => [
'text/xml' => 'bestyii\xml\parser\XmlParser',
'application/xml' => 'bestyii\xml\parser\XmlParser',
],
],
],
];
Test
$ phpunit