ModuleStats

This trait calls the Configurator class and if there is a ModuleStats array, then it gets it.

trait ModuleStats
{
    /**
     * @param \XoopsModules\xxxxx\Common\Configurator $configurator
     * @return array
     */

    public static function getModuleStats($configurator)
    {
        $moduleStats = [];
        if (\count($configurator->moduleStats) > 0) {
            foreach (\array_keys($configurator->moduleStats) as $i) {
                $moduleStats[$i] = $configurator->moduleStats[$i];
            }
        }

        return $moduleStats;
    }
}

The ModuleStats are defined in /config/config.php file. For example, for Publisher, the stats are defined as:

resulting in this view:

Last updated

Was this helpful?