Exponent v2.7.2

expHistory extends expSubsystem
in package

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'); }
Tags
subpackage

Subsystems

Table of Contents

$history  : array<string|int, mixed>
__construct()  : mixed
expHistory Constructor
__get()  : null
Generic magic method
__isset()  : bool
Generic magic method
__set()  : mixed
Generic magic method We MUST create/set non-existing properties for Exponent code to work
__unset()  : mixed
Generic magic method
back()  : mixed
This function will redirect the user to the last page or action not marked as editable.
flush()  : mixed
getBack()  : mixed
Returns a history item further back in time than the most recent (last) one
getLast()  : mixed
getLastNotEditable()  : mixed
goHere()  : mixed
lastNotEditable()  : mixed
lastUrl()  : mixed
print_history()  : mixed
redirecto_login()  : mixed
Redirects to the login page if necessary
returnTo()  : mixed
set()  : mixed
setHistory()  : mixed

Properties

$history

public array<string|int, mixed> $history = array()
Tags
access

public

Methods

__construct()

expHistory Constructor

public __construct() : mixed

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.

Return values
mixed

__get()

Generic magic method

public __get( $property) : null
Parameters
$property :
Return values
null

__isset()

Generic magic method

public __isset( $property) : bool
Parameters
$property :
Return values
bool

__set()

Generic magic method We MUST create/set non-existing properties for Exponent code to work

public __set( $property,  $value) : mixed
Parameters
$property :
$value :
Return values
mixed

__unset()

Generic magic method

public __unset( $property) : mixed
Parameters
$property :
Return values
mixed

back()

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

public static back() : mixed
Return values
mixed

flush()

public static flush() : mixed
Return values
mixed

getBack()

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

public static getBack( $depth) : mixed
Parameters
$depth :

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

Tags
static
Return values
mixed

getLast()

public static getLast([mixed $url_type = null ]) : mixed
Parameters
$url_type : mixed = null
Return values
mixed

getLastNotEditable()

public static getLastNotEditable() : mixed
Return values
mixed

goHere()

public goHere([mixed $url_type = null ][, mixed $params = array() ]) : mixed
Parameters
$url_type : mixed = null
$params : mixed = array()
Return values
mixed

lastNotEditable()

public lastNotEditable() : mixed
Return values
mixed

lastUrl()

public lastUrl([mixed $url_type = null ]) : mixed
Parameters
$url_type : mixed = null
Return values
mixed

print_history()

public static print_history() : mixed
Return values
mixed

redirecto_login()

Redirects to the login page if necessary

public static redirecto_login([null $redirecturl = null ]) : mixed
Parameters
$redirecturl : null = null
Return values
mixed

returnTo()

public static returnTo([mixed $url_type = null ][, mixed $params = array() ]) : mixed
Parameters
$url_type : mixed = null
$params : mixed = array()
Return values
mixed

set()

public static set(mixed $url_type, mixed $params[, mixed $force = false ]) : mixed
Parameters
$url_type : mixed
$params : mixed
$force : mixed = false
Return values
mixed

setHistory()

public setHistory(mixed $url_type, mixed $params) : mixed
Parameters
$url_type : mixed
$params : mixed
Return values
mixed

Search results