PHPackages                             tecnoready/yii2-jms-serializer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tecnoready/yii2-jms-serializer

ActiveYii2-extension[Parsing &amp; Serialization](/categories/parsing)

tecnoready/yii2-jms-serializer
==============================

JMS Serializer extension for the Yii framework

2.0.0(10y ago)0391MITPHPPHP &gt;=5.5

Since Oct 5Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Tecnocreaciones/yii2-jms-serializer)[ Packagist](https://packagist.org/packages/tecnoready/yii2-jms-serializer)[ Docs](https://github.com/krtv/yii2-jms-serializer)[ RSS](/packages/tecnoready-yii2-jms-serializer/feed)WikiDiscussions 2.0.x Synced 2mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

krtv/yii2-jms-serializer
========================

[](#krtvyii2-jms-serializer)

This extension provides a `Serializer` component, that would allow you to use [JMS Serializer](http://jmsyst.com/libs/serializer) library with [Yii framework 2.0](http://www.yiiframework.com).

JMSSerializer allows you to (de-)serialize data of any complexity. Currently, this extension supports JSON and XML.

It also provides you with a rich tool-set to adapt the output to your specific needs.

Built-in features include:

- (De-)serialize data of any complexity; circular references are handled gracefully.
- Supports many built-in PHP types (such as dates)
- Supports versioning, e.g. for APIs
- Configurable via PHP, XML and YAML

For license information check the [LICENSE](LICENSE.md)-file.

Documentation is at [docs/guide/README.md](docs/guide/README.md).

[![Build Status](https://camo.githubusercontent.com/8df8221e4a72613f7437f20e795564036cc6a20546206ef2e219324ce1666080/68747470733a2f2f7472617669732d63692e6f72672f6b6f726f746f76736b792f796969322d6a6d732d73657269616c697a65722e7376673f6272616e63683d322e302e78)](https://travis-ci.org/korotovsky/yii2-jms-serializer)

Install
-------

[](#install)

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

Either run

```
php composer.phar require --prefer-dist krtv/yii2-jms-serializer
```

or add

```
"krtv/yii2-jms-serializer": "~2.0.0"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

To use this extension, simply add the following code in your application configuration:

```
return [
    // ...
    'components' => [
        'serializer' => [
            'class' => 'krtv\yii2\serializer\Serializer',
            'formats' => [
                'json',

                // XML is also available to use.
                // 'xml',
            ],

            // Uncomment if you would like to use handlers: http://jmsyst.com/libs/serializer/master/handlers
            //
            // 'handlers' => [
            //    'datetime' => [
            //        'defaultFormat' => 'c',  // ISO8601
            //    ],
            //    'my_handler' => [
            //        'class' => 'app\\serializer\\handler\\MyHandler',
            //    ],
            //    // ...
            // ],

            // Uncomment if you would like to use different naming strategy for properties.
            // "camel_case" is a default one. Available strategies are: "camel_case", "identical" and "custom".
            //
            // 'namingStrategy' => [
            //     'name' => 'camel_case',
            //     'options' => [
            //         'separator' => '_',
            //         'lowerCase' => true,
            //     ],
            // ],

            // Uncomment if you would like to configure class-metadata or enable cache.
            //
            // 'metadata' => [
            //     'cache' => true,
            //     'directories' => [
            //         [
            //             'namespace' => 'Foo\\Bar',
            //             'alias' => '@app/config/serializer/foo/bar',
            //         ],
            //         // ...
            //     ]
            // ],
        ],

        // ...
    ],

    // ...
];
```

Now you can access to an `krtv\yii2\serializer\Serializer` instance through `\Yii::$app->serializer` or `\Yii::$container->get('serializer')`.

Data serialization:

```
echo $serializer->serialize(['foo' => 'bar'], 'json'); // {"foo": "bar"}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~352 days

Total

2

Last Release

3520d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfce7e9b7caf3cdeea60e9584b09e8878afb8180115a23f37502f4a26eb5bfa9?d=identicon)[INHack20](/maintainers/INHack20)

---

Top Contributors

[![INHack20](https://avatars.githubusercontent.com/u/1240646?v=4)](https://github.com/INHack20 "INHack20 (9 commits)")[![korotovsky](https://avatars.githubusercontent.com/u/104727?v=4)](https://github.com/korotovsky "korotovsky (5 commits)")

---

Tags

jsonserializationdeserializationjmsyii2jms-serializer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tecnoready-yii2-jms-serializer/health.svg)

```
[![Health](https://phpackages.com/badges/tecnoready-yii2-jms-serializer/health.svg)](https://phpackages.com/packages/tecnoready-yii2-jms-serializer)
```

###  Alternatives

[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
