oxenti/historic

There is no license information available for the latest version (dev-master) of this package.

Historic Behavior for CakePHP

Installs: 16

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Open Issues: 0

Type:cakephp-plugin

dev-master 2015-10-30 17:59 UTC

This package is not auto-updated.

Last update: 2024-04-21 06:04:59 UTC


README

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).