PHP code example of jorge / cakephp3utilities

1. Go to this page and download the library: Download jorge/cakephp3utilities 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/ */

    

jorge / cakephp3utilities example snippets




public function validationDefault(Validator $validator)
{
    $validator
        ->provider('custom', new \JCustomCakephp3\Validation\CustomProvider)
        ->add('birth', 'valid', ['rule' => 'dateBR', 'provider' => 'custom'])
        ->

$this->loadComponent('CakePHP3Utilities.Gerencianet');
$this->Gerencianet->item('Produto 1', 1, '1.200,00');
$this->Gerencianet->vencimento('2015-10-30');
$this->Gerencianet->retorno(time(), 'http://www.suaurl.com.br', 'http://www.suaurl.com.br');
$this->Gerencianet->cliente(
    'Maria da Silva',
    '[email protected]',
    '(11) 98549-8123',
    '1980-11-24',
    '120.445.115-00'
);
$this->Gerencianet->endereco(
    '02462-020',
    'Rua Manoel Almeida Santos',
    '524',
    null,
    'V. Paulista',
    'Sao Paulo',
    'SP'
);
$this->Gerencianet->marketplace('3VTV93SFBKHL');
$this->Gerencianet->periodicidade(1);
$return = $this->Gerencianet->enviar();

$this->loadComponent('CakePHP3Utilities.CPanel');
if ($this->CPanel->domainCreatedSub('subdomain', 'yourdomain.com.br')) {
    # code...
} else {
    $this->Flash->error(__($this->CPanel->error));
}