2017 © Pedro Peláez
 

yii2-extension yii2-cms-core

CMS Core extension for Yii2.

image

maddoger/yii2-cms-core

CMS Core extension for Yii2.

  • Tuesday, January 26, 2016
  • by maddoger
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Yii2 Core Module by maddoger, (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist maddoger/yii2-cms-core "*"

or add, (*4)

"maddoger/yii2-cms-core": "*"

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

Logging to DB

'log' => [
    'traceLevel' => YII_DEBUG ? 3 : 0,
    'targets' => [

        'db' => [
            'class' => 'yii\log\DbTarget',
            'levels' => ['error', 'warning'],
            'except'=>['yii\web\HttpException:*', 'yii\i18n\I18N\*'],
            'prefix'=>function () {
                $url = !Yii::$app->request->isConsoleRequest ? Yii::$app->request->getUrl() : null;
                return sprintf('[%s][%s]', Yii::$app->id, $url);
            },
            'logTable' => '{{%core_log}}',
        ],
    ],
],

Configuration

Configurations in modules - properties - models (frontend & backend), (*6)

For usage: - loading - reading interface (model or property), (*7)

For editing: - view - model - load/save interface, (*8)

ConfigurationBehavior, (*9)

Universal behavior., (*10)

'configurationBehavior' => [
    'class' => ConfigurationBehavior::className(),
    'key' => $this->id.'_custom', //owner class by default

    //Reading
    'attributes' => [
        //Default values
        'logoText' => $this->logoText,
        'logoImageUrl' => $this->logoImageUrl,
        'sortNumber' => $this->sortNumber,
    ],
    'saveToOwnerProperties' => true, // if true all attributes will be written in owner properties
                                     // otherwise configuration model/array will be available through getConfiguration()

    //Editing
    'view' => $this->getViewPath() . DIRECTORY_SEPARATOR . 'configuration.php',
    //Model for user
    'modelClass' => 'maddoger\admin\model\Configuration.php',
    //OR
    'dynamicModel' => [
        'formName' => $this->id,
        'rules' => [
            [['logoText', 'logoImageUrl'], 'string'],
            [['logoText', 'logoImageUrl', 'sortNumber'], 'default', ['value' => null]],
        ],
    ]
]

The Versions

26/01 2016

dev-master

9999999-dev

CMS Core extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

26/01 2016

v1.1.0

1.1.0.0

CMS Core extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

19/10 2015

v1.0.1

1.0.1.0

CMS Core extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov

12/10 2015

v1.0.0

1.0.0.0

CMS Core extension for Yii2.

  Sources   Download

The Requires

 

by Vitaliy Syrchikov