Processes

The concept of a process in the framework is the idea of the state loop which has a private entry point from a public page and returns the user back to the public page. For example, in order to login a user must pass through the following states:

show login form → validate login → display login error (if any) → return user to previous state

A user can initiate a login on any page on these four states must be passed through. Data is not modified or committed until the last step. In the framework this series of steps is called a process and is defined in gadGetStates().

Processes have several advantages. When a process is entered the public state that the user is and is saved until the process declares itself over with. Processes are unified security model that is checked with a single set of permissions (so that each state like 'load-form' and 'commit-form' don't have to be individually validated). Processes allow advancement through the states through simplified URL-getting mechanisms.

A description of how to mark the process is covered in gadGetStates().

Once the process is defined, the next state is obtained by the following line:

$url = $this->getPage()->gadStatURL($this, GSR_NEXT, $idparams);

To get the current URL one calls:

$url = $this->getPage()->gadStatURL($this, GSR_CURRENT, $idparams);

The state of the next URL is automatically calculated. The context is automatically appended to the URL.

Join AW and support river stewardship nationwide!