PHPackages                             pragmatic-modules/magento2-module-jslayout-parser - 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. pragmatic-modules/magento2-module-jslayout-parser

ActiveMagento2-module

pragmatic-modules/magento2-module-jslayout-parser
=================================================

Lightweight Magento 2 module that was created to make work with $jsLayout less spaghetti, and more object-oriented.

1.0.0(4y ago)156.7k↓100%31MITPHP

Since Feb 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pragmatic-modules/magento2-module-jslayout-parser)[ Packagist](https://packagist.org/packages/pragmatic-modules/magento2-module-jslayout-parser)[ Docs](https://rusin.work)[ RSS](/packages/pragmatic-modules-magento2-module-jslayout-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

JS Layout Parser
================

[](#js-layout-parser)

Lightweight Magento 2 module that was created to make work with `$jsLayout` less spaghetti, and more object-oriented.

Alternative Version
-------------------

[](#alternative-version)

After Michal's reasonable advice I moved whole code out of this module into standalone PHP library that can be found at [pragmatic-modules/jslayout-parser](https://github.com/pragmatic-modules/jslayout-parser)

This lets you avoid unnecessary entry in the `app/etc/config.php`

Besides that, whole API remains the same.

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

[](#installation)

```
composer require pragmatic-modules/magento2-module-jslayout-parser
bin/magento module:enable Pragmatic_JsLayoutParser
bin/magento setup:upgrade

```

Usage On Checkout
-----------------

[](#usage-on-checkout)

Add new layout processor by implementing `LayoutProcessorInterface`, and inject it into `layoutProcessors` array.

File: `etc/frontend/di.xml`

```

                Pragmatic\Example\Block\Checkout\ExampleProcessor

```

Inject `Pragmatic\JsLayoutParser\Model\JsLayoutParser` into processor and parse `$jsLayout` for selected root component.

You can find a list of available component methods below.

```
