Skip to content

oxenti/Historic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Historic Behavior for cakephp

This add Behavior de historic for table

Requirements

  • CakePHP 3.0+

Installation

You can install this behavior into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require oxenti/historic

Configuration

In your app's config/bootstrap.php add:

// In config/bootstrap.php
Plugin::load('Historic');

or using cake's console:

./bin/cake plugin load Historic

On your app's,model add the Histotic Behevior in initialize method:

    ...
     $this->addBehavior('Historic.Historic'[
        'class' => 'Historic`s table'
        'fields' => ['fields']//fields that should be saved on historic table
    ]);
    ...

Configuration files [optional]

Move the 'address.php' config file from the plugin's config folder to your app's config folder.

On your app's 'bootstrap.php' add the address configuration file:

    ...
    try {
	    Configure::config('default', new PhpConfig());
	    Configure::load('app', 'default', false);
	} catch (\Exception $e) {
	    die($e->getMessage() . "\n");
	}

	Configure::load('historic', 'default');
    ...

Warning

Historic's table require field is_active tyniInt(1).

About

Behavior para uma tabela que deve guarda um histórico.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages