2017 © Pedro Peláez
 

yii2-extension yii2-honors

This component allows users to work with the achievements.

image

maks757/yii2-honors

This component allows users to work with the achievements.

  • Thursday, November 3, 2016
  • by maks757
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

yii2 honors

status extension dev

Install

composer.phar require maks757/yii2-honors

or, (*1)

composer require maks757/yii2-honors

and applying migrations, (*2)

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

or, (*3)

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

Configuration

main.php (config)
'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,
                        ],
                    ]
                ],
            ]
        ]
    ],
    // ...
]

url to list honor = admin panel url + /honor/honor/list url to create honor = admin panel url + /honor url to list user honor = admin panel url + /honor/honor/user, (*4)

Using

Go to add new honor Alt text and add new honor Alt text and add honor to user Alt text, (*5)

Using example

//action 
//honors
    $honors = HonorUser::find()->where(['user_id' => $userId])->with(['honor.translations'])->all();
//
//view
<?php if (!empty($honors)): ?>
    <div class="col-md-12">
            <h3 class="about-user">Honors:</h3>
        <div class="row text-center" style="padding: 2px 10px;">
            <?php /** @var $honor \bl\honors\entities\HonorUser*/?>
            <?php foreach ($honors as $honor): ?>
                <div class="col-xs-4 col-sm-3 col-md-1" style="padding: 0;">
                    <img src="<?= $honor->honor->getImage($honor->honor->image) ?>"
                         width="50" height="50"
                         data-toggle="tooltip" data-placement="top"
                         title="<?= $honor->honor->translation->name ?>">
                </div>
            <?php endforeach; ?>
        </div>
    </div>
<?php endif; ?>

Alt text, (*6)

The Versions

03/11 2016

dev-master

9999999-dev

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 honors module honors component honors

03/11 2016

1.1.4

1.1.4.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 honors module honors component honors

03/11 2016

1.1.3

1.1.3.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 honors module honors component honors

19/10 2016

1.1.2

1.1.2.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 honors module honors component honors

27/09 2016

1.0.2

1.0.2.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 honors module honors component honors

27/09 2016

1.0.1

1.0.1.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 honors module honors component honors

22/09 2016

0.0.1

0.0.1.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 honors module honors component honors