2017 © Pedro Peláez
 

yii2-extension yii2-json-field

Help you to define fields, that can contains json. Json in this fields would be automatically serialized and deserialized

image

skobka/yii2-json-field

Help you to define fields, that can contains json. Json in this fields would be automatically serialized and deserialized

  • Saturday, February 4, 2017
  • by skobka
  • Repository
  • 1 Watchers
  • 1 Stars
  • 292 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 10 % Grown

The README.md

Yii2 JSON Field

Help you to define fields, that can contains json. Json in this fields would be automatically serialized and deserialized, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require skobka/yii2-json-field

or add, (*4)

"skobka/yii2-json-field": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)


### Product.php /** * @property object|array|null $field1 */ class Product extends AvtiveRecord { use JsonFieldTrait; public function behaviors() { return [ 'field1' => [ 'class' => JsonFieldBehavior::class, 'dataField' => 'json_field_1', // this is the name of field in db table ], ]; } } ### ProductController.php // saving $product = Product::findOne(['id' => 1]); $product->field1 = new \StdClass(); $product->field1->foo = 'bar'; $product->save(); $product = Product::findOne(['id' => 1]); print $product->field1->foo; // bar

The Versions

04/02 2017

dev-master

9999999-dev

Help you to define fields, that can contains json. Json in this fields would be automatically serialized and deserialized

  Sources   Download

Apache-2.0

The Requires

 

by Soshnikov Artem

extension json yii2 field

04/02 2017

v1.0.3

1.0.3.0

Help you to define fields, that can contains json. Json in this fields would be automatically serialized and deserialized

  Sources   Download

Apache-2.0

The Requires

 

by Soshnikov Artem

extension json yii2 field

04/02 2017

v1.0.2

1.0.2.0

Help you to define fields, that can contains json. Json in this fields would be automatically serialized and deserialized

  Sources   Download

Apache-2.0

The Requires

 

by Soshnikov Artem

extension json yii2 field

03/02 2017

v1.0.1

1.0.1.0

Help you to define fields, that can contains json. Json in this fields would be automatically serialized and deserialized

  Sources   Download

Apache-2.0

The Requires

 

by Soshnikov Artem

extension json yii2 field