2017 © Pedro Peláez
 

yii2-extension yii2-progress

This component allows users to work with the achievements.

image

maks757/yii2-progress

This component allows users to work with the achievements.

  • Sunday, December 11, 2016
  • by maks757
  • Repository
  • 1 Watchers
  • 0 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 21 Versions
  • 4 % Grown

The README.md

Yii2 progress user

Install

php composer.phar require maks757/yii2-progress

or, (*1)

composer require maks757/yii2-progress

and applying migrations, (*2)

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

or, (*3)

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

Configuration

main.php (config)
'components' => [
    // Progress config
    'progress' => [
        'class' => \bl\progress\Progress::className(),
        'validatorClass' => \bl\progress\components\ProgressComponent::className(),
        'honors' => [
            // name category
            'userConfirm' => [
                'class' => \bl\progress\components\ValidateProgress::className(), //class validator
                'name' => 'Registration success', // name user progress
                'image' => Yii::getAlias('@vendor/maks757/yii2-progress/image/user.png'), //path to image
                'long_description' => '', // 255 chars
                'short_description' => '', // 100 chars
            ]
        ]
    ],
    // Images config
    'imagableProgress' => [
        'class' => 'bl\imagable\Imagable',
        'imageClass' => \bl\progress\components\image\CreateImageImagine::className(),
        'nameClass' => \bl\progress\components\image\GenerateName::className(),
        'imagesPath' => '@webroot/progressImage',
        'categories' => [
            'category' => [
                'progress' => [
                    'origin' => false,
                    'size' => [
                        'long' => [
                            'width' => 500,
                            'height' => 500,
                        ],
                        'short' => [
                            'width' => 200,
                            'height' => 200,
                        ],
                    ]
                ],
            ]
        ]
    ],
    // ...
]

Using

Add, (*4)

    /**
    *@var Progress $progress
    */
    $progress = Yii::$app->progress;

and, (*5)

    // First variant
    // 1 param ( progress category )
    // 2 param ( user id )
    $progress->validateOne('userConfirm', 1);

or, (*6)

    // Second variant
    // 1 param ( progress category )
    // its use current user id
    $progress->validate('userConfirm');

Using example

$userProgress = \bl\progress\entities\UserProgress::getUserProgress($userRegisterInfo->id);
foreach ($userProgress as $value)
{
    /** *@var Progress $progress */
    $progress = Yii::$app->progress;
    $pathImage = $progress->getImage($value->image->image, 'progress', 'short');

    $content = Html::tag('h3', $value->name);
    $content .= Html::img($pathImage);
    echo Html::tag('div', $content, ['class' => 'col-sm-2']);
}

Alt text, (*7)

The Versions

11/12 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 progress maks757 module progress component progress

11/12 2016

2.5.8

2.5.8.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

11/12 2016

2.5.7

2.5.7.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

11/12 2016

2.5.6

2.5.6.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

08/11 2016

2.5.5

2.5.5.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

08/11 2016

2.4.5

2.4.5.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

08/11 2016

2.3.5

2.3.5.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

08/11 2016

2.3.4

2.3.4.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

08/11 2016

2.2.4

2.2.4.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

08/11 2016

2.2.3

2.2.3.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

07/11 2016

2.2.2

2.2.2.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

07/11 2016

2.2.1

2.2.1.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

26/10 2016

2.1.1

2.1.1.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

21/09 2016

2.0.0

2.0.0.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

21/09 2016

2.0.1

2.0.1.0

This component allows users to work with the achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

21/09 2016

1.0.0

1.0.0.0

Components and modules for the management achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

19/09 2016

0.0.5

0.0.5.0

Components and modules for the management achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module progress component progress

19/09 2016

0.0.4

0.0.4.0

Components and modules for the management achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 progress maks757 module honers component honers

16/09 2016

0.0.3

0.0.3.0

Components and modules for the management achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 module honers component honers honers

16/09 2016

0.0.2

0.0.2.0

Components and modules for the management achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 module honers component honers honers

16/09 2016

0.0.1

0.0.1.0

Components and modules for the management achievements.

  Sources   Download

GNU Public License

The Requires

 

by Maxim Cherednyk

yii2 maks757 module honers component honers honers