yii2-extension yii2-config
Form package for SkeekS CMS
skeeks/yii2-config
Form package for SkeekS CMS
- Monday, May 21, 2018
- by skeeks-semenov
- Repository
- 1 Watchers
- 0 Stars
- 121 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 109 % Grown
Yii2 config area for SkeekS CMS
Links
namespace skeeks\cms\widgets;
use skeeks\yii2\config\ConfigBehavior;
use skeeks\yii2\config\ConfigTrait;
use yii\base\Widget;
use yii\helpers\ArrayHelper;
/**
* Class GridView
* @package skeeks\cms
*/
class TestWidget extends Widget
{
use ConfigTrait;
public $test = '22';
public $config = [];
public function behaviors()
{
return ArrayHelper::merge(parent::behaviors(), [
ConfigBehavior::class => ArrayHelper::merge([
'class' => ConfigBehavior::class,
'configModel' => [
'fields' => [
'test'
],
'attributeDefines' => [
'test',
],
'attributeLabels' => [
'test' => '111',
],
'attributeHints' => [
'test' => '111',
],
'rules' => [
['test', 'string']
]
]
], (array) $this->config),
]);
}
public function run()
{
return $this->test;
}
}
SkeekS CMS (Yii2) — quickly, easily and effectively!
skeeks.com | cms.skeeks.com, (*1)