PHP code example of maks757 / yii2-honors

1. Go to this page and download the library: Download maks757/yii2-honors 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/ */

    

maks757 / yii2-honors example snippets


'modules' => [
    'honor' => [
        'class' => \bl\honors\HonorsModule::className()
    ],
],
'components' => [
    // Images config
    'imagableHonor' => [
        'class' => 'bl\imagable\Imagable',
        'imageClass' => \bl\honors\components\image\CreateImageImagine::className(),
        'nameClass' => \bl\honors\components\image\GenerateName::className(),
        'imagesPath' => '@frontend/web/honorImage',
        'categories' => [
            'category' => [
                'honor' => [
                    'origin' => false,
                    'size' => [
                        'long' => [
                            'width' => 500,
                            'height' => 500,
                        ],
                        'short' => [
                            'width' => 200,
                            'height' => 200,
                        ],
                    ]
                ],
            ]
        ]
    ],
    // ...
]

//action 
//honors
    $honors = HonorUser::find()->where(['user_id' => $userId])->with(['honor.translations'])->all();
//
//view
 if (!empty($honors)): 

php yii migrate --migrationPath=@vendor/maks757/yii2-honors/migrations