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.
<b>DEFINITIONS</b>
<ul>
<li><b>viewable</b> - standard (public) page/view like that for showall, show, etc...</li>
<li><b>manageable</b> - page/view with list of editable items for management like manage_tags, etc... Typically you wouldn't edit in this view</li>
<li><b>editable</b> - a page/view used to edit an item or settings</li>
</ul>
<b>USAGE EXAMPLES:</b>
<b>Example: How to set a history WayPoint</b>
This example shows how you would use expHistory to set a waypoint inside one of your actions
<code>
public function showall() {
expHistory::set('viewable', $this->params);
$record = new foo($id);
assign_to_template(array('record'=>$record));
}
</code>
<b>Example: Return to a waypoint (automagically)</b>
This example shows how to let expHistory::back() automagically determine where to route the user after an action completes
<code>
public function delete() {
$record = new foo($id);
$record->delete();
expHistory::back();
}
</code>
<b>Example: Return to a waypoint 'type' (manually)</b>
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.
<code>
public function delete() {
$record = new foo($id);
$record->delete();
expHistory::returnTo('editable');
}
</code>
« More »
expPaginator¶
This is the class expPaginator
Exponent Pagination Subsystem
The expPaginator class is used to retrieve objects from the database
and paginate them and optionally group the by category.
It automagically handles the calls to other pages
and has built-in sorting using the defined column headers.
Usage Example:
<code>
$page = new expPaginator(array(
'model'=>'faq',
'where'=>1,
'limit'=>25,
'order'=>'rank',
'controller'=>$this->baseclassname,
'action'=>$this->params['action'],
'columns'=>array('In FAQ'=>'include_in_faq', 'Submitted'=>'created_at', 'Submitted By'=>'submitter_name'),
));
</code>
« More »