当前位置: 首页>>代码示例>>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;未经允许,请勿转载。