本文整理匯總了PHP中CRM_Core_Selector_Controller::_template方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_Selector_Controller::_template方法的具體用法?PHP CRM_Core_Selector_Controller::_template怎麽用?PHP CRM_Core_Selector_Controller::_template使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Core_Selector_Controller
的用法示例。
在下文中一共展示了CRM_Core_Selector_Controller::_template方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
/**
* Class constructor
*
* @param CRM_Core_Selector_API $object an object that implements the selector API
* @param int $pageID default pageID
* @param int $sortID default sortID
* @param int $action the actions to potentially support
* @param CRM_Core_Page|CRM_Core_Form $store place in session to store some values
* @param int $output what do we so with the output, session/template//both
*
* @return Object
* @access public
*/
function __construct($object, $pageID, $sortID, $action, $store = NULL, $output = self::TEMPLATE, $prefix = NULL, $case = NULL)
{
$this->_object = $object;
$this->_pageID = $pageID ? $pageID : 1;
$this->_sortID = $sortID ? $sortID : NULL;
$this->_action = $action;
$this->_store = $store;
$this->_output = $output;
$this->_prefix = $prefix;
$this->_case = $case;
// fix sortID
if ($this->_sortID && strpos($this->_sortID, '_') === FALSE) {
$this->_sortID .= '_u';
}
$params = array('pageID' => $this->_pageID);
// let the constructor initialize this, should happen only once
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
}
$this->_sortOrder =& $this->_object->getSortOrder($action);
$this->_sort = new CRM_Utils_Sort($this->_sortOrder, $this->_sortID);
/*
* if we are in transfer mode, do not goto database, use the
* session values instead
*/
if ($output == self::TRANSFER) {
$params['total'] = $this->_store->get($this->_prefix . 'rowCount');
} else {
$params['total'] = $this->_object->getTotalCount($action, $this->_case);
}
$this->_total = $params['total'];
$this->_object->getPagerParams($action, $params);
/*
* Set the default values of RowsPerPage
*/
$storeRowCount = $store->get($this->_prefix . CRM_Utils_Pager::PAGE_ROWCOUNT);
if ($storeRowCount) {
$params['rowCount'] = $storeRowCount;
} elseif (!isset($params['rowCount'])) {
$params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
}
$this->_pager = new CRM_Utils_Pager($params);
list($this->_pagerOffset, $this->_pagerRowCount) = $this->_pager->getOffsetAndRowCount();
}