Skip to content

coderius/yii2-hit-counter

Repository files navigation

Yii2 hit counter extention

Installation

The preferred way to install this extension is through composer.

First download module . Run the command in the terminal:

composer require "coderius/yii2-hit-counter"

or add in composer.json

"coderius/yii2-hit-counter": "^1.0"

and run composer update

Run migrations in root folder project:

php yii migrate/to m190926_110717_hit_counter__table --migrationPath=@coderius/hitCounter/migrations

Usage

Include module in app config file. In advanced template go to common/main.php and set to config array next params:

    $conf = [
        ...
    ];
    
    $conf['modules']['hitCounter'] = [
            'class' => 'coderius\hitCounter\Module',
        ];

    $conf['bootstrap'][] = 'coderius\hitCounter\config\Bootstrap';

In view file past hit counter widget:

<?= \coderius\hitCounter\widgets\hitCounter\HitCounterWidget::widget([]); ?>

About

Yii2 hit counter module for collecting and analyzing statistics on visitors.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages