PHPackages                             lugano/yii2-count-user - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lugano/yii2-count-user

ActiveYii2-extension

lugano/yii2-count-user
======================

Count views and users on site.

1.0.1(9y ago)036BSD-3-ClausePHP

Since Jun 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Luganos/yii2-count-user)[ Packagist](https://packagist.org/packages/lugano/yii2-count-user)[ RSS](/packages/lugano-yii2-count-user/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

yii2-count-user
===============

[](#yii2-count-user)

\#Module of count of users for YII2 with report by email

Installation

Extension may be installed by taking the following simple steps:

1. add "lugano/yii2-count-user": "\*" to the require section of your composer.json file.
2. run composer install to install the specified extensions.
3. execute yii migrate --migrationPath=vendor/lugano/yii2-count-user/migrations

Usage

Suppose, You have site with 4 pages. These pages has been displaying user using SiteController. This SiteController extends Controller from YII2, and has methods , called actionIndex, actionAdverbs, actionVerbs, actionDictionary.

Code below shows default YII2 controller for site.

SiteController extends Controller {

public $hosts;

public $views;

public function actionIndex(){

```
  self::countUser();
  return $this->render('index');

```

}

public function actionAdverbs(){

```
  self::countUser();
  return $this->render('adverbs');

```

}

public function actionVerbs(){

```
 self::countUser();
 return $this->render('verbs');

```

}

public function actionDictionary(){

```
  self::countUser();
  return $this->render('dictionary');

```

} }

In order to count users and views your site you must do several action:

1. Add use lugano\\userCounter\\controllers\\DefaultController; in header file with your SiteController;
2. Add method in you SiteController(your default controller);

    public function countUser() { $settings = array( 'posmail' =&gt; '', 'posname' =&gt; 'my-site.com', 'period' =&gt; '1...365' ); $temp = new DefaultController($settings); $report = $temp-&gt;counter(); $this-&gt;views = $report\['views'\]; $this-&gt;hosts = $report\['hosts'\];

    }
3. Add two public properties $host and $views to your SiteController;
4. Call self::countUser() in each your method actionIndex, actionAdverbs, actionVerbs, actionDictionary
5. Add to your main.php file string like

context-&gt;hosts .' '.'Views: '. $this-&gt;context-&gt;views; ?&gt; Describing for variable $setting of class "DefaultController"

'posmail' - email will be receiving report from site; 'posname' - name for sender(your site); 'period' - period between reports from you site(not less than 1 and not more than 365 days);

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3620d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/096138a036972249752fd8dc6bce7c533f9aa3194fda351a24c6a0b2244d9bc6?d=identicon)[Lugano](/maintainers/Lugano)

---

Top Contributors

[![Luganos](https://avatars.githubusercontent.com/u/15790678?v=4)](https://github.com/Luganos "Luganos (3 commits)")[![Merecoder](https://avatars.githubusercontent.com/u/21024091?v=4)](https://github.com/Merecoder "Merecoder (1 commits)")

---

Tags

yii2Usersviewscount

### Embed Badge

![Health badge](/badges/lugano-yii2-count-user/health.svg)

```
[![Health](https://phpackages.com/badges/lugano-yii2-count-user/health.svg)](https://phpackages.com/packages/lugano-yii2-count-user)
```

###  Alternatives

[budyaga/yii2-users

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

409.1k](/packages/budyaga-yii2-users)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
