PHPackages                             chattervast/jsond - 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. [Templating &amp; Views](/categories/templating)
4. /
5. chattervast/jsond

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

chattervast/jsond
=================

Adds Twig filters for working with json.

00PHP

Since Oct 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/chattervast/Jsond)[ Packagist](https://packagist.org/packages/chattervast/jsond)[ RSS](/packages/chattervast-jsond/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Json'd plugin for Craft CMS 3.x
===============================

[](#jsond-plugin-for-craft-cms-3x)

Adds Twig filters for working with json.

[![Screenshot](resources/img/plugin-logo.png)](resources/img/plugin-logo.png)

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0-beta.23 or later.

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

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require chattervast/jsond

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Json'd.

Json'd Overview
---------------

[](#jsond-overview)

Json'd adds 3 twig filters: |json\_decoded , |json\_last\_error , and |json\_last\_error\_msg .

Using Json'd
------------

[](#using-jsond)

### json\_decoded

[](#json_decoded)

Pass a json string to |json\_decoded and it will return an object.

`{{ entry.jsonField|json_decoded }}`

To return an array instead of an object, pass a parameter of 'true'.

`{{ entry.jsonField|json_decoded('true') }}`

|json\_decoded accepts all of the parameters that the json\_decoded function in PHP accepts.

`{{ entry.jsonField|json_decoded('object/associative', 'depth', 'option') }}`

Object/associative is set to false by default returning an object. Depth (passed as an integer), sets the depth to which the json is decoded. Default recursion depth in PHP is 512. Options available are: JSON\_BIGINT\_AS\_STRING - Decodes large integers as their original string value. JSON\_OBJECT\_AS\_ARRAY - Decodes as array. Default of |json\_decoded. JSON\_THROW\_ON\_ERROR - Throws JsonException if an error occurs instead of setting the global error state that is retrieved with json\_last\_error().

### json\_last\_error\_msg

[](#json_last_error_msg)

Returns the error string of json\_decoded.

`{{ entry.jsonField|json_last_error_msg }}`

Accepts 'encode' as a parameter to return the error string of json\_encode.

`{{ entry.jsonField|json_last_error_msg('encode') }}`

### json\_last\_error

[](#json_last_error)

Returns the last error of json\_decoded.

`{{ entry.jsonField|json_last_error }}`

Accepts 'encode' as a parameter to return the last error of json\_encode.

`{{ entry.jsonField|json_last_error('encode') }}`

PHP Documentation
-----------------

[](#php-documentation)

To read the full documentation of the PHP functions and their accepted parameters and return values, see these links:

[json\_decoded](http://php.net/manual/en/function.json-decode.php)[json\_last\_error\_msg](http://php.net/manual/en/function.json-last-error-msg.php)[json\_last\_error](http://php.net/manual/en/function.json-last-error.php)

Brought to you by [Chattervast](https://github.com/chattervast)

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![chattervast](https://avatars.githubusercontent.com/u/72415207?v=4)](https://github.com/chattervast "chattervast (2 commits)")

### Embed Badge

![Health badge](/badges/chattervast-jsond/health.svg)

```
[![Health](https://phpackages.com/badges/chattervast-jsond/health.svg)](https://phpackages.com/packages/chattervast-jsond)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)[awkwardideas/switchblade

Extended blade directives for laravel

102.1k](/packages/awkwardideas-switchblade)

PHPackages © 2026

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