當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ResultContext::getTableName方法代碼示例

本文整理匯總了PHP中ResultContext::getTableName方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResultContext::getTableName方法的具體用法?PHP ResultContext::getTableName怎麽用?PHP ResultContext::getTableName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ResultContext的用法示例。


在下文中一共展示了ResultContext::getTableName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getResultsLinkForLastFind

 /**
  * Returns a Link to the results screen for the last find
  *
  * @param $po_request - the current request
  * @param $pm_table_name_or_num - the name or number of the table to get the last find operation for
  * @param $ps_content - the link content
  * @param $class - (optional) name of a CSS class to apply to the link
  * @param $pa_params - (optional) associative array of parameters to append onto the link URL
  * @param $pa_attributes - (optional) associative array of values to use as attributes in the key (keys are attribute names and values are attribute values)
  * @return string - an HTML link that will link back to the results for the last find operation
  */
 public static function getResultsLinkForLastFind($po_request, $pm_table_name_or_num, $ps_content, $ps_class = null, $pa_params = null, $pa_attributes = null)
 {
     if (!($vs_table_name = ResultContext::getTableName($pm_table_name_or_num))) {
         return null;
     }
     $vs_last_find = ResultContext::getLastFind($po_request, $pm_table_name_or_num);
     $va_tmp = explode('/', $vs_last_find);
     $o_find_navigation = Configuration::load(__CA_APP_DIR__ . '/conf/find_navigation.conf');
     $va_find_nav = $o_find_navigation->getAssoc($vs_table_name);
     $va_nav = $va_find_nav[$va_tmp[0]];
     if (!$va_nav) {
         return false;
     }
     if (__CA_APP_TYPE__ == 'PAWTUCKET') {
         // Pawtucket-specific navigation rewriting
         if (!(require_once __CA_APP_DIR__ . "/controllers/" . (trim($va_nav['module_path']) ? trim($va_nav['module_path']) . "/" : "") . $va_nav['controller'] . "Controller.php")) {
             return false;
         }
         $vs_controller_class = $va_nav['controller'] . "Controller";
         $va_nav = call_user_func_array("{$vs_controller_class}::" . $va_nav['action'], array($po_request, $vs_table_name));
         $o_storage = ResultContext::_persistentStorageInstance($po_request);
         if (!($vs_action = $o_storage->getVar('result_last_context_' . $vs_table_name . '_action'))) {
             $vs_action = $va_nav['action'];
         }
     } else {
         $vs_action = $va_nav['action'];
     }
     $va_params = array();
     if (is_array($va_nav['params'])) {
         $o_context = new ResultContext($po_request, $pm_table_name_or_num, $va_tmp[0], isset($va_tmp[1]) ? $va_tmp[1] : null);
         foreach ($va_nav['params'] as $vs_param) {
             if (!($vs_param = trim($vs_param))) {
                 continue;
             }
             if (!trim($va_params[$vs_param] = $po_request->getParameter($vs_param, pString))) {
                 $va_params[$vs_param] = trim($o_context->getParameter($vs_param));
             }
         }
         if (!is_array($pa_params)) {
             $pa_params = array();
         }
         $pa_params = array_merge($pa_params, $va_params);
     }
     return caNavLink($po_request, $ps_content, $ps_class, trim($va_nav['module_path']), trim($va_nav['controller']), trim($vs_action), $pa_params, $pa_attributes);
 }
開發者ID:idiscussforum,項目名稱:providence,代碼行數:56,代碼來源:ResultContext.php

示例2: getResultsLinkForLastFind

 /**
  * Returns a Link to the results screen for the last find
  *
  * @param $po_request - the current request
  * @param $pm_table_name_or_num - the name or number of the table to get the last find operation for
  * @param $ps_content - the link content
  * @param $class - (optional) name of a CSS class to apply to the link
  * @param $pa_params - (optional) associative array of parameters to append onto the link URL
  * @param $pa_attributes - (optional) associative array of values to use as attributes in the key (keys are attribute names and values are attribute values)
  * @return string - an HTML link that will link back to the results for the last find operation
  */
 public static function getResultsLinkForLastFind($po_request, $pm_table_name_or_num, $ps_content, $ps_class = null, $pa_params = null, $pa_attributes = null)
 {
     if (!($vs_table_name = ResultContext::getTableName($pm_table_name_or_num))) {
         return null;
     }
     $vs_last_find = ResultContext::getLastFind($po_request, $pm_table_name_or_num);
     $o_find_navigation = Configuration::load($po_request->config->get('find_navigation'));
     $va_find_nav = $o_find_navigation->getAssoc($vs_table_name);
     $va_nav = $va_find_nav[$vs_last_find];
     if (!$va_nav) {
         return false;
     }
     $va_params = array();
     if (is_array($va_nav['params'])) {
         $o_context = new ResultContext($po_request, $pm_table_name_or_num, $vs_last_find);
         foreach ($va_nav['params'] as $vs_param) {
             if (!($vs_param = trim($vs_param))) {
                 continue;
             }
             if (!trim($va_params[$vs_param] = $po_request->getParameter($vs_param, pString))) {
                 $va_params[$vs_param] = trim($o_context->getParameter($vs_param));
             }
         }
         if (!is_array($pa_params)) {
             $pa_params = array();
         }
         $pa_params = array_merge($pa_params, $va_params);
     }
     return caNavLink($po_request, $ps_content, $ps_class, trim($va_nav['module_path']), trim($va_nav['controller']), trim($va_nav['action']), $pa_params, $pa_attributes);
 }
開發者ID:guaykuru,項目名稱:pawtucket,代碼行數:41,代碼來源:ResultContext.php


注:本文中的ResultContext::getTableName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。