opatrickvico/history

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

Class that implements the memento pattern poorly, allowing for undo/redo functionality;

1.0.0 2023-12-13 13:10 UTC

This package is not auto-updated.

Last update: 2024-10-03 15:28:09 UTC


README

Simple PHP class that (poorly) implements the memento pattern for undo/redo features.

How to use it

The class has three methods:

  • addHistory: Takes the state you want to register. Everytime the state is changed, new history must be added;
  • undo: Returns the previous state;
  • redo: Returns the state ahead.