Download the PHP package laxity7/yii2-json-field without Composer
On this page you can find all versions of the php package laxity7/yii2-json-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download laxity7/yii2-json-field
More information about laxity7/yii2-json-field
Files in laxity7/yii2-json-field
Download laxity7/yii2-json-field
More information about laxity7/yii2-json-field
Files in laxity7/yii2-json-field
Vendor laxity7
Package yii2-json-field
Short Description Behavior that convert array to JSON before save data in model, and also convert JSON to an array after saving and retrieving data
License MIT
Homepage https://github.com/laxity7/yii2-json-field
Package yii2-json-field
Short Description Behavior that convert array to JSON before save data in model, and also convert JSON to an array after saving and retrieving data
License MIT
Homepage https://github.com/laxity7/yii2-json-field
Please rate this library. Is it a good library?
Informations about the package yii2-json-field
Yii2 JsonFieldBehavior
This behavior adds advanced support for working with JSON data in Yii2 active record models. Behavior convert array to JSON before save data in model, and also convert JSON to an array after saving and retrieving data. Use JSON fields like normal fields with an array or object.
Install
Install via composer
How to use
To use JsonFieldBehavior, insert the following code to your ActiveRecord class:
You can also pass the following parameters:
- jsonOptions
int
(by defaultJSON_UNESCAPED_UNICODE
) JSON constants can be combined to form options for json_encode(). - defaultValue
array|string
(by default'[]'
) The default value for attribute. This value by default will be stored in the database if the field value is empty. Ignored if [[skipEmpty]] is enabled. - skipEmpty
bool
(by defaulttrue
) Whether to skip a field if it's empty. When TRUE in the database, the field can be null, when FALSE will save an empty object ('[]' or see defaultValue) - asArray
bool
(by defaulttrue
) Decode JSON into an array or object.
So, the complete list of settings will look like this:
All versions of yii2-json-field with dependencies
PHP Build Version
Package Version
The package laxity7/yii2-json-field contains the following files
Loading the files please wait ....