2017 © Pedro Peláez
 

yii2-extension yii2-article

Yii2-article is a module offering basic CMS-functionality

image

asinfotrack/yii2-article

Yii2-article is a module offering basic CMS-functionality

  • Wednesday, July 25, 2018
  • by asinfotrack
  • Repository
  • 4 Watchers
  • 2 Stars
  • 60 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 76 % Grown

The README.md

Yii2-article

Yii2-article is a lightweight cms extension, (*1)

Installation

Basic installation

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

Either run, (*3)

$ composer require asinfotrack/yii2-article

or add, (*4)

"asinfotrack/yii2-article": "~1.0.1"

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

Migration

After downloading you need to apply the migration creating the required tables:, (*6)

yii migrate --migrationPath=@vendor/asinfotrack/yii2-article/migrations

To remove the table just do the same migration downwards., (*7)

Add the module to the yii-config

    'modules'=>[

        //your other modules...

        'article'=>[
            'class'=>'asinfotrack\yii2\article\Module',

            'userRelationCallback'=>function ($model, $attribute) {
                return $model->hasOne('app\models\User', ['id'=>$attribute]);
            },
            'backendArticleAccessControl' = [
                'class'=>'yii\filters\AccessControl',
                'rules'=>[
                    ['allow'=>true, 'roles'=>['@']],
                ],
            ],
            'backendArticleCategoryAccessControl' = [
                'class'=>'yii\filters\AccessControl',
                'rules'=>[
                    ['allow'=>true, 'roles'=>['@']],
                ],
            ],

            'components'=>[   
                //configuration of the renderer         
                'renderer'=>[
                    'class'=>'asinfotrack\yii2\article\components\ArticleRenderer',
                    'addDataAttributesToArticleTagOptions'=>true,
                    'showDebugTags'=>false,
                    'placeholderCallbackMap'=>[
                        //example for a custom placeholder for an image tag                        
                        'img'=>function ($params) {
                            return Html::img($params[0]);
                        },

                        //your other custom placeholder tags here...
                    ],
                ],                
            ],
        ],
    ],

For a full list of options, see the attributes of the classes within the module. Especially check the classes asinfotrack\yii2\article\Module and asinfotrack\yii2\article\components\ArticleRenderer. Some examples are provided below., (*8)

Bootstrapping the module

This step is optional and only necessary when you want to use the ArticleAction in a controller outside the actual module., (*9)

Add the module to the bootstrap-array of your yii-config to ensure it is loaded when the third party controller accesses the ArticleRender. Make sure you use the same module-ID as you use in the step right above., (*10)

'bootstrap'=>['log', 'article'],

Changelog

Learn about the latest improvements., (*11)

The Versions

25/07 2018

dev-master

9999999-dev

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

25/07 2018

0.8.8

0.8.8.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

25/07 2018

0.8.7

0.8.7.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

13/07 2018

0.8.6

0.8.6.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

12/07 2018

0.8.5

0.8.5.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

11/05 2018

0.8.4

0.8.4.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

11/05 2018

dev-feature/menuitem-article-category

dev-feature/menuitem-article-category

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

03/05 2018

0.8.3

0.8.3.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

03/05 2018

0.8.2

0.8.2.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

03/05 2018

0.8.1

0.8.1.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

02/05 2018

0.8.0

0.8.0.0

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article

12/03 2018

dev-feature/menu

dev-feature/menu

Yii2-article is a module offering basic CMS-functionality

  Sources   Download

MIT

The Requires

 

yii2 bundle cms widget behavior action article