PHP code example of adaoex / zf2-base

1. Go to this page and download the library: Download adaoex/zf2-base library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adaoex / zf2-base example snippets


"    "adaoex/zf2-base": "dev-master"
}

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

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

ZF2Base\View\Helper\String
 
$this->string( [$string] ); 

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

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

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

$this->moeda( $numero ); 

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

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

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

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

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

$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();