2017 © Pedro Peláez
 

cakephp-plugin cake-simple-model-history

CakeSimpleModelHistory plugin for CakePHP (mazba.github.io)

image

mazba/cake-simple-model-history

CakeSimpleModelHistory plugin for CakePHP (mazba.github.io)

  • Tuesday, December 20, 2016
  • by mazba
  • Repository
  • 1 Watchers
  • 4 Stars
  • 10 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 67 % Grown

The README.md

CakeSimpleModelHistory plugin for CakePHP

Installation

You can install this plugin into your CakePHP application using composer., (*1)

Add the following lines to your application's composer.json:, (*2)

    "require": {
       "mazba/cake-simple-model-history": "dev-master"
    }   

followed by the command: composer update, (*3)

Or, (*4)

The recommended way to install composer packages is:, (*5)

    composer require "mazba/cake-simple-model-history:dev-master"   

Setup

In config/bootstrap.php add:, (*6)

    Plugin::load('CakeSimpleModelHistory', ['bootstrap' => false, 'routes' => true]);

or using CakePHP's console:, (*7)

    ./bin/cake plugin load CakeSimpleModelHistory

Configuration

Add the following line to your AppController:, (*8)

    use CakeSimpleModelHistory\Controller\ActivityLogsTrait;

Add the following inside your AppController Class, (*9)

    class AppController extends Controller
    {
        use ActivityLogsTrait;
    }

Finally, you'll also need to run migration on the package, (*10)

    cake migrations migrate -p CakeSimpleModelHistory

Attach the behavior in the models you want with:, (*11)

    public function initialize(array $config) {
        $this->addBehavior('CakeSimpleModelHistory.ActivityLogs');
    }

To view history : /cake-simple-model-history

The Versions

20/12 2016

dev-master

9999999-dev

CakeSimpleModelHistory plugin for CakePHP (mazba.github.io)

  Sources   Download

The Requires

 

The Development Requires