dotallineed/yii2-widgets-builder

An extension for creating and storing html widgets with content to the database for Yii2 site builder

dev-master 2016-11-22 12:14 UTC

This package is not auto-updated.

Last update: 2024-09-23 13:44:21 UTC


README

An extension for creating and storing html widgets with content to the database for Yii2 site builder

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist dotallineed/yii2-widgets-builder "dev-master"

or add

"dotallineed/yii2-widgets-builder": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, Add the following code in your main configuration file

'builderwidgets' => [
           'class' => 'dotallineed\widgetsbuilder\BuilderWidget',
   		
           'storage' => [
               'class' => 'dotallineed\widgetsbuilder\MultipleStorage',
               'storages' => [
                   [
                       'class' => 'dotallineed\widgetsbuilder\DatabaseStorage',
                       'table' => 'builder_widgets',
                   ],
               ],
           ]		
   		
       ],

and simply use it in your code by :

  $builder_widgets=Yii::$app->builderwidgets;```