PHPackages                             the\_it\_nerd/module-core - 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. [Framework](/categories/framework)
4. /
5. the\_it\_nerd/module-core

ActiveMagento2-module[Framework](/categories/framework)

the\_it\_nerd/module-core
=========================

The IT Nerd - Magento 2 Core Module.

0.0.6(1y ago)29.9k↓22.2%4[2 PRs](https://github.com/the-it-nerd/magento-module-core/pulls)3OSL-3.0JavaScript

Since May 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/the-it-nerd/magento-module-core)[ Packagist](https://packagist.org/packages/the_it_nerd/module-core)[ Docs](https://github.com/the-it-nerd/magento-module-core)[ RSS](/packages/the-it-nerd-module-core/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (7)Used By (3)

Introdução
==========

[](#introdução)

Este módulo é a base para os módulos OpenSource da comunidade The IT Nerd.

Instalação
==========

[](#instalação)

Instale via composer

```
composer require the_it_nerd/module-core

```

Funcionalidades
===============

[](#funcionalidades)

Este módulo atua como base para os outros módulos provendo as seguintes fruncionalidades:

- Menu "The IT Nerd" no admin
- Aba de configuração "The IT Nerd" no admin
- Implementação de biblioteca de mascara no frontend
- Model para facilitar o uso de cache para armazenar objetos e variaveis

Como usar a biblioteca de mascara
---------------------------------

[](#como-usar-a-biblioteca-de-mascara)

A bilbioteca de mascaras utiliza como base a biblioteca [Igor Escobar jQuery Mask](github.com/igorescobar/jQuery-Mask-Plugin).

### Implementação por x-mage-init

[](#implementação-por-x-mage-init)

Esta implementação leva em consideração o uso do incialização padrão do Magento 2 x-mage-init

```

{
    "#telephone": {
        "TheITNerd_Core/js/inputMask": {
            "mask": "(00) 0000-00000"
        }
    }
}

```

### Knockout data bind

[](#knockout-data-bind)

Este modo pode ser usado em phtmls ou arquivos html de templates knockout utilizando o método data-bind

```

```

### Implementação por requireJS

[](#implementação-por-requirejs)

Quando for necessário o uso de implementação de mascara através de um arquivo JS.

```
define([
    'jquery',
    'TheITNerd_Core/js/inputMask'
], function($) {
    'use strict';

    $.widget('theitnerd.test', {
        options: {
            mask: '00000-000',
        },

        _create: function() {
            this.initMask();
        },

        /**
         * Implements Mask on field
         * @returns {theitnerd.test}
         */
        initMask: function() {
            this.element.inputmask({mask: this.options.mask});

            return this;
        }
    });

    return $.theitnerd.test;
});

```

Como usar o model de cache
--------------------------

[](#como-usar-o-model-de-cache)

O model cache facilita o uso da implementação padrão de cache de backend do Magento2

### Como salvar uma cache

[](#como-salvar-uma-cache)

No cliente da cache temos o metodo save, que leva em consideração os seguintes parametros.

ParâmetroDescriçãoObservaçãostring $keyChave única da cacheé esperado uma string para identificar a cachemixed $dataDados serem salvosPode ser passado qualquer variavel ou objeto que possa ser serializado.array $tags = \[\]Tags para facilitar a limpezaPor exemplo cms\_p ou catalog\_pint $ttl = 86400Valor do tempo de validade da cacheO valor precisa ser do tipo int e o tempo é considerado em segundos, ou seja 86400 = 24hstring $scope = 'global'O escopo usado para salvar a cacheE$stá variavel espera os valores "store", "website" ou "global", e ele adicionara o ID do website ou da store atual na key da cache para diferenciar a cache por website ou store view### Como recuperar uma cache

[](#como-recuperar-uma-cache)

O metodo Load facilita o carregametno o valores salvos em cache

ParâmetroDescriçãoObservaçãostring $keyChave única da cacheé esperado uma string para identificar a cachestring $scope = 'global'O escopo usado para salvar a cacheE$stá variavel espera os valores "store", "website" ou "global", e ele adicionara o ID do website ou da store atual na key da cache para diferenciar a cache por website ou store view### Exemplo de implementção

[](#exemplo-de-implementção)

```
use TheITNerd\Core\Model\CacheClient;

class TestClass {

    /**
     * @param CacheClient   $cacheClient
     */
    public function __construct(
        private CacheClient   $cacheClient
    )
    {
    }

    public function getData(string $key): array
    {
        //generate an unique cache key
        $cacheKey = md5($key);

        if($data = $this->cacheClient->load($cacheKey, 'website')) {
            return $data;
        }

        ...

        $data = array[]

        $this->cacheClient->save($cacheKey, $data, ['tag1, 'tag2'], 86400, 'website');

        return $data;

    }

    ...
}

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance42

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.7% 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

Every ~119 days

Recently: every ~148 days

Total

6

Last Release

474d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6bf9725ab90fab25ff2dd7e97875572367ff9c5b166ddcf62cbf584d0581b5a?d=identicon)[rqsakai](/maintainers/rqsakai)

---

Top Contributors

[![rqsakai](https://avatars.githubusercontent.com/u/1054239?v=4)](https://github.com/rqsakai "rqsakai (11 commits)")[![michelsilva04](https://avatars.githubusercontent.com/u/2080062?v=4)](https://github.com/michelsilva04 "michelsilva04 (1 commits)")

---

Tags

magentomagento2

### Embed Badge

![Health badge](/badges/the-it-nerd-module-core/health.svg)

```
[![Health](https://phpackages.com/badges/the-it-nerd-module-core/health.svg)](https://phpackages.com/packages/the-it-nerd-module-core)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[smile/module-elasticsuite-cms-search

Smile Elasticsuite - Cms Pages Search Module for Smile Elasticsuite.

25916.7k1](/packages/smile-module-elasticsuite-cms-search)[smile/elasticsuite-for-retailer

Smile ElasticSuite for Retailers - Magento2 toolkit for Retailers : Store Locator, Availability and Prices per store, etc...

18235.4k](/packages/smile-elasticsuite-for-retailer)[smile/module-elasticsuite-rating

Smile ElasticSuite - Rating search module.

1492.1k2](/packages/smile-module-elasticsuite-rating)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

119.1k](/packages/opengento-module-category-import-export)

PHPackages © 2026

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