Cts_Controller_Action_Abstract

Author

Jaybill McCarthy

See Also

Zend_Controller_Action

Instance Variables

$_logger

$_loggedInUser

$_theme_locations

protected $_theme_locations

Instance Methods

init

function init()

Initializes the current instance.

View Variables

host_idif specified in the config.ini, this will be set to the host name.  Used primarily in sites with multiple mirrored machines.
site_urlThe base URL of the website.  Pulled from the registry.
site_nameThe value of site_name from the registry.
admin_roleThe name of the admin role.  Pulled from the registry.
guest_roleThe name of the guest role.  Pulled from the registry.
mcaA concatenation of the names of the model, controller, and action.  Useful as a body class selector when you want different models, controllers, and/or actions to be styled differently.  Does not account for routes.  Use gingerly.
controller_nameThe name of the current controller.
module_nameThe name of the current module.
action_nameThe name of the current action.
isLoggedInIndicates whether the current user is logged in.  (boolean)
loggedInUsernameThe username of the current user if they are logged in, or null otherwise.
loggedInFullNameThe full name of the current user if they are logged in, or null otherwise.
loggedInRoleIdThe role ID of the current user if they are logged in, or null otherwise.
loggedInUserArray containing the data from the row in the user table of the logged in user.  Does not exist if user is not logged in.
isAdminIndicates whether the current user is a member of the administrator role.  (boolean)
last_loginThe last login fate of the currently logged in user
format_dateA format string for date.  Pulled from the registry.
format_datetimeA format string for date with time.  Pulled from the registry.
format_datetime_smallA format string for short date and time.  Pulled from the registry.
current_yearThe current year as a 4 digit integer.
theme_pathfull path to the base dir of the current theme
theme_urlrelative url of the base dir current theme
theme_global_pathfull path to the /global dir of the current theme
theme_controller_pathfull path to the current controller’s template directory
theme_module_pathfull path to the default module’s theme directory
default_theme_pathfull path to the base dir of the default theme
default_theme_urlrelative url of the base dir default theme
default_theme_global_pathfull path to the /global dir of the default theme
default_theme_controller_pathfull path to the current controller’s default template directory
default_theme_module_pathfull path to the current module’s default theme directory
title_prefixSet in the config.  Can be used by themes in the title tag
view_statesAn array of key value pairs (stored in the session) representing the state of certain pages.  For instance, the last time you viewed the list of users, you were on page 3.
isAdminControllera boolean that specifies if this is an admin controller.
module_xxxxIf module xxxx is enabled, this will be true.  If it’s not, this won’t exist.

Plugin Hooks

  • controller_init (filter) - Allows you to perform additional actions just before the init method terminates.
param usernameThe username of the current user if they are logged in, or null otherwise.
  • controller_nav (filter) - Allows you to modify the navigation array before it is assigned to the view.
param nav_itemsThe array of links returned by the Navigation model class.
param requestThe HTTP Request object.

Private or Protected Methods

makePager

protected function makePager($page,  
$per_page,  
$total,  
$url,  
$params =  null)

Adds paging information to a view.  This works independently of any collection.  You basically describe the collection to this method and you get back some view variables.

Arguments

$pageThe index of the page to display.  (0-based)
$per_pageThe number of items to display per page.
$totalThe total number of items in the entire collection.
$urlThe URL of the page on which the pager is being displayed.
$params (optional)An open-ended customizable array of key-value-paired parameters.  Pairs passed in will be added to the $url argument as parameters.  Default is null.

View Variables

pager_urlThe $url argument with optional $params added to it.
page_infoPager status.  Information about the page you are on (e.g.: 11 to 20 of 87)
nextThe index of the page after the current page.  (0-based)
lastThe index of the last page in the entire collection.  (0-based)
prevThe index of the page before the current page.  (0-based)
firstThe index of the first page in the entire collection.  (0-based)
totalThe total number of items being paged.  This is the $total argument passed out unaltered.
pageThe index of the current page.  (0-based)
display_pageThe index of the current page.  (1-based)
total_pagesThe total number of pages in the entire collection.
pagesAn array of integers, one for each page in the entire collection.  (1-based)
protected $_theme_locations
function init()
Initializes the current instance.
protected function makePager($page,  
$per_page,  
$total,  
$url,  
$params =  null)
Adds paging information to a view.
Close