expHistory

This is the class expHistory Exponent History Subsystem

The expHistory class is responsible for keeping track of which pages a user has visited while on the site. It also tracks what type of page/view each one is, viewable, manageable, editable and uses this information to intelligently route the user to proper places. A developer can also use the methods of this class help Exponent know where to route users.

DEFINITIONS

  • viewable - standard (public) page/view like that for showall, show, etc...
  • manageable - page/view with list of editable items for management like manage_tags, etc... Typically you wouldn't edit in this view
  • editable - a page/view used to edit an item or settings

USAGE EXAMPLES:

Example: How to set a history WayPoint

This example shows how you would use expHistory to set a waypoint inside one of your actions

public function showall() { expHistory::set('viewable', $this->params); $record = new foo($id); assign_to_template(array('record'=>$record)); }

Example: Return to a waypoint (automagically)

This example shows how to let expHistory::back() automagically determine where to route the user after an action completes

public function delete() { $record = new foo($id); $record->delete(); expHistory::back(); }

Example: Return to a waypoint 'type' (manually) This example shows how use expHistory::returnTo() to manually route the user after an action completes. In this example the user will be routed to the last form he/she was on.

public function delete() { $record = new foo($id); $record->delete(); expHistory::returnTo('editable'); }

package

Subsystems

subpackage

Subsystems

Methods

expHistory Constructor

__construct() 

The constructor will grab the users history from the session. If it is not present in the session it will be initialized and saved later.

This function will redirect the user to the last page or action not marked as editable.

back() 
static

flush

flush() 
static

Returns a history item further back in time than the most recent (last) one

getBack( $depth) : mixed
static
static

Arguments

$depth

int How deep/far back in history to pull a link

Response

mixed

getLast

getLast( $url_type = null) 
static

Arguments

$url_type

getLastNotEditable

getLastNotEditable() 
static

goHere

goHere( $url_type = null,  $params = array()) 

Arguments

$url_type

$params

lastNotEditable

lastNotEditable() 

lastUrl

lastUrl( $url_type = null) 

Arguments

$url_type

print_history

print_history() 
static

returnTo

returnTo( $url_type = null,  $params = array()) 
static

Arguments

$url_type

$params

set

set( $url_type,  $params) 
static

Arguments

$url_type

$params

setHistory

setHistory( $url_type,  $params) 

Arguments

$url_type

$params

Properties

history

history : array
access

public

var

Type(s)

array