PHPackages                             adaoex/zf2-base - 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. adaoex/zf2-base

ActiveLibrary[Framework](/categories/framework)

adaoex/zf2-base
===============

Módulo 'BaseController' para projeto que utilize Zend Framework 2, por @adaoex

v1.0.2(11y ago)2331BSD-3-ClausePHPPHP &gt;=5.3.17

Since Jan 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/adaoex/zf2-base)[ Packagist](https://packagist.org/packages/adaoex/zf2-base)[ Docs](https://github.com/adaoex/zf2-base)[ RSS](/packages/adaoex-zf2-base/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

ZF2Base
=======

[](#zf2base)

Módulo 'Base' para projeto que utilize Zend Framework 2 em complemento ao [Zend Skeleton Application](https://github.com/zendframework/ZendSkeletonApplication)

Requisitos (Requirements)
-------------------------

[](#requisitos-requirements)

- [Zend Framework 2](https://github.com/zendframework/zf2)
- [DoctrineORM](https://github.com/doctrine/DoctrineORMModule)

Instalação (Instalation)
------------------------

[](#instalação-instalation)

### Via composer

[](#via-composer)

```
"require": {
    "adaoex/zf2-base": "dev-master"
}
```

Registre o módulo no ZendSkeletonApplication

```
'modules' => array(
 // ..
 'ZF2Base',
)
```

Módulo
------

[](#módulo)

### Form\\Validator

[](#formvalidator)

Classes que extendem 'Zend\\Validator\\AbstractValidator'

```
ZF2Base\Form\Validator\Cnpj
ZF2Base\Form\Validator\Cpf
ZF2Base\Form\Validator\CpfCnpj
```

### View\\Helpers

[](#viewhelpers)

```
ZF2Base\View\Helper\String
```

Utilização - Nas views (arquivos .phtml)

Retorna String no formato UTF-8, independente do formado de entrada

```
$this->string( [$string] );
```

retorna string no formato UTF-8, uma substring (acrescido de ... ), caso o $tamanho for maior que o tamanho da string original

```
$this->string()->truncar( $string, $tamanho );
```

### ZF2Base\\View\\Helper\\Numero

[](#zf2baseviewhelpernumero)

Retorna número por extenso

```
$this->numero( [$numero] );
```

OU

```
$this->numero()->porExtenso( $numero );
```

### ZF2Base\\View\\Helper\\Moeda

[](#zf2baseviewhelpermoeda)

Retorna número no formato brasileiro (locale: pt\_BR, currency: BRL)

```
$this->moeda( $numero );
```

OU

```
$this->moeda()->formataBr( $numero );

$this->moeda()=>porExtenso( $numero );
```

### ZF2Base\\View\\Helper\\Formatar

[](#zf2baseviewhelperformatar)

Retorna string formatada

```
	$this->formata()->cep( $string );
	$this->formata()->cnpj( $string );
	$this->formata()->cpf( $string );
	$this->formata()->telefone( $string );
```

### ZF2Base\\View\\Helper\\Data

[](#zf2baseviewhelperdata)

Tratamentos para Datas

```
$this->data()->porExtenso( $data );
$this->data()->dataHora( $data );
```

### Mail

[](#mail)

- Configurações em ..\\config\\autoload\\global.php

```
return array(
	'mail' => array(
		'name' => 'smtp.googlemail.com',
		'host' => 'smtp.googlemail.com',
		'connection_class' => 'login',
		'connection_config' => array(
			'username' => 'email@gmail.com',
			'password' => '123',
			'ssl' => 'tls',
			'port' => 465,
			'from' => 'email@gmail.com'
		)
	)
);
```

Utilização em Controllers

```
$transport = $this->getServiceLocator()->get("ZF2Base\Mail\Transport");
$view = $service = $this->getServiceLocator()->get("View");
$mail = new Mail($transport, $view, 'page-template');
$mail->setSubject( ... )
		->setTo( ... )
		->setData( ... )
		->prepare()
		->send();
```

### ZF2Base\\Controller

[](#zf2basecontroller)

- BaseController

- Get Zend\\Session;
- Get EntityManager;
- CRUD Controller;
- Zend\\Paginator;

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

4185d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/856432?v=4)[Adão Gonçalves](/maintainers/adaoex)[@adaoex](https://github.com/adaoex)

---

Top Contributors

[![adaoex](https://avatars.githubusercontent.com/u/856432?v=4)](https://github.com/adaoex "adaoex (10 commits)")

---

Tags

frameworkmodulecrudzf2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/adaoex-zf2-base/health.svg)

```
[![Health](https://phpackages.com/badges/adaoex-zf2-base/health.svg)](https://phpackages.com/packages/adaoex-zf2-base)
```

PHPackages © 2026

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