2017 © Pedro Peláez
 

library cakephp3utilities

Utilities for CakePHP 3.x

image

jorge/cakephp3utilities

Utilities for CakePHP 3.x

  • Monday, February 8, 2016
  • by jorgejardim
  • Repository
  • 1 Watchers
  • 0 Stars
  • 129 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Utilities for CakePHP 3.x

  • Gerencianet
  • Cpanel XmlApi

Install

Composer:, (*1)

require: "jorge/cakephp3utilities": "dev-master"

Configuration

'CPanel' => [
    'default' => [
        'domain' => 'tryggu.com.br',
        'username' => 'tryggu',
        'password' => 't4r5zjj',
        'port' => '2082',
        'debug' => true
    ]
],
'Gerencianet' => [
    'token' => 'ADFS7F834KDJULJORGE5993485H5KK3GG2234678',
],

Gerencianet Example

$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@teste.com.br',
    '(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();

Cpanel XmlApi Example

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

Example of Validation of Brazilian data

Add on Model:, (*2)

<?php

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

Rules: - dateBR - datetimeBR - cnpj - cpf - cep - phone - cellphone, (*3)

The Versions

08/02 2016

dev-master

9999999-dev

Utilities for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

cakephp cakephp3 cake3 cpanel gerencianet

08/02 2016

0.1.1

0.1.1.0

Utilities for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

cakephp cakephp3 cake3 cpanel gerencianet

13/01 2016

0.1

0.1.0.0

Utilities for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

cakephp cakephp3 cake3 cpanel gerencianet