2017 © Pedro PelĆ”ez
 

cakephp-plugin custom-cakephp3

CakePHP 3 Custom

image

jorge/custom-cakephp3

CakePHP 3 Custom

  • Monday, June 8, 2015
  • by jorgejardim
  • Repository
  • 1 Watchers
  • 0 Stars
  • 376 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

CUSTOM CAKEPHP 3.X

InstalaĆ§Ć£o

<?php
    Plugin::load("JCustomCakephp3");

Como usar

1. Ajuste dos campos de data para o formato SQL americano.

Add no Model:, (*1)

<?php

    class PostsTable extends Table
    {
        public function initialize($config = [])
        {
            $this->addBehavior("JCustomCakephp3.ConvertDate");
        }
    }

ou, (*2)

<?php

    class PostsTable extends Table
    {
        public function initialize($config = [])
        {
            $this->addBehavior("JCustomCakephp3.ConvertDate", ['fild_name1', 'fild_name2']);
        }
    }

2. ValidaĆ§Ć£o de dados brasileiros.

Add no Model no mƩtodo validationDefault():, (*3)

<?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, (*4)

The Versions

08/06 2015

dev-master

9999999-dev

CakePHP 3 Custom

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp facebook cakephp3

08/06 2015

v1.0

1.0.0.0

CakePHP 3 Custom

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp facebook cakephp3