ErstwhileController is the base class for themes in Erstwhile. It doesn’t have many specific methods to be overridden, but it does have certain conventions to follow when using it.
There are two primary types of methods specified in controllers:
- Actions: By the default Erstwhile routing behavior, these each get turned into routes and are accessed via URLs like
/<controllerName>/<actionName>. Actions always have method names ending withAction. - Modals: Modals are similar to Actions, but are triggered when calling the application’s
openModal()method. They have a special scope calledmodalthat can store variables outside ofsessionandpage. Modals always have method names ending inModal.
There are also two reserved methods that can be overreidden called preAction() and postAction(), which are called as part of the request lifecycle.