当前位置: 首页>>代码示例>>PHP>>正文


PHP JApplication::getUserStateFromRequest方法代码示例

本文整理汇总了PHP中JApplication::getUserStateFromRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplication::getUserStateFromRequest方法的具体用法?PHP JApplication::getUserStateFromRequest怎么用?PHP JApplication::getUserStateFromRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JApplication的用法示例。


在下文中一共展示了JApplication::getUserStateFromRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getItemModel

 /**
  * Return an instance of a model that loaded base on configuration
  * @param mixed $config
  * @param object $state
  * @param string $coverage
  * @return JModelList
  */
 private function getItemModel($config, $state, $coverage)
 {
     $path = '';
     // Load model file
     if (!$config['path']) {
         $path = JPATH_ADMINISTRATOR . '/';
     } else {
         $path = $config['path'] . '/';
     }
     require_once $path . $config['modelfile'];
     // Load component language
     $this->language->load($config['language'], JPATH_ADMINISTRATOR);
     // Create model instance
     $model = new $config['modelname'](array('state' => $state));
     $model->getState('filter.search');
     $currentCoverage = $this->app->getUserStateFromRequest('components.selected', 'tab');
     if ($currentCoverage == $coverage) {
         $order = $this->app->getUserStateFromRequest("{$currentCoverage}.{$config['modelname']}.order", 'filter_order', $config['order']);
         $orderDir = $this->app->getUserStateFromRequest("{$currentCoverage}.{$config['modelname']}.orderDir", 'filter_order_Dir', 'asc');
         $state->set('list.ordering', $order);
         $state->set('list.direction', $orderDir);
     }
     $state->set('filter.search', $this->keyword);
     $state->set('filter.published', 'all');
     $state->set('filter.state', 'all');
     if (isset($config['filters']) && is_array($config['filters'])) {
         foreach ($config['filters'] as $key => $value) {
             $state->set($key, $value);
         }
     }
     return $model;
 }
开发者ID:NallelyFlores89,项目名称:basvec,代码行数:39,代码来源:view.html.php

示例2: __construct

 /**
  * @param string $entity
  */
 public function __construct($entity, $init)
 {
     $this->app = JFactory::getApplication();
     $this->db = JFactory::getDBO();
     $option = 'com_acctexp';
     $this->filtered = false;
     $this->limit = $this->app->getUserStateFromRequest("viewlistlimit", 'limit', $this->app->getCfg('list_limit'));
     $this->limitstart = $this->app->getUserStateFromRequest("viewconf{$option}limitstart", 'limitstart', 0);
     $this->search = xJ::escape($this->db, trim(strtolower($this->app->getUserStateFromRequest("search{$option}_subscr", 'search', ''))));
     if (!empty($this->search)) {
         $this->filtered = true;
     }
     $this->filter = new stdClass();
     if (!empty($init['filter'])) {
         foreach ($init['filter'] as $key => $default) {
             $value = $this->app->getUserStateFromRequest('aec_' . $entity . '_' . $key, $entity . '_' . $key, $default);
             if (!empty($_REQUEST[$key])) {
                 $value = $_REQUEST[$key];
             }
             if (is_array($default) && !is_array($value)) {
                 $value = array($value);
             }
             $this->filter->{$key} = $value;
             if ($this->filter->{$key} != $default) {
                 $this->filtered = true;
             }
         }
     }
     if (!empty($init['sort'])) {
         $this->{$key} = $this->app->getUserStateFromRequest('aec_' . $entity . '_sort', $entity . '_sort', $init['sort']);
     }
     if (empty($this->sort)) {
         $this->sort = 'id ASC';
     }
 }
开发者ID:Ibrahim1,项目名称:aec,代码行数:38,代码来源:admin.acctexp.php

示例3: getUserStateFromRequest

 /**
  * Gets the value of a user state variable.
  *
  * @param  string  $stateName  Unique name of state
  * @param  string  $reqName    The name of the variable passed in a request.
  * @param  string  $default    First value if not initialized
  * @return string              State
  */
 function getUserStateFromRequest($stateName, $reqName, $default = null)
 {
     return $this->_baseFramework->getUserStateFromRequest($stateName, $reqName, $default);
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:12,代码来源:CBframework.php


注:本文中的JApplication::getUserStateFromRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。