PHP code example of nullref / yii2-blog

1. Go to this page and download the library: Download nullref/yii2-blog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nullref / yii2-blog example snippets


'blog' => [
    'class' => "nullref\\blog\\Module",  
    'classMap'=>[
        'Post' => 'app\models\Post',
        'PostSearch' => 'nullref\app\PostSearch',
        'PostQuery' => 'app\models\PostQuery',
        'BlogStatusList' => 'app\components\BlogStatusList',
    ],
],


namespace app\components;


class BlogStatusList extends \nullref\blog\components\BlogStatusList
{
    const STATUS_HIDE = 3;

    public function getList()
    {
        return array_merge(parent::getList(),[
            self::STATUS_HIDE => \Yii::t('app','Hide'),
        ]);
    }
}

php composer.phar