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


PHP Main::app方法代码示例

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


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

示例1: getUrl

 public function getUrl($path, $params = array())
 {
     if ($params === null) {
         $params = array();
     }
     // Delegate path autocomplete to current controller
     $path = Main::app()->getCurrentController()->autocompleteUrlPath($path);
     $paramString = '';
     $sysParams = array();
     foreach ($params as $k => $v) {
         if (strpos($k, '_') === 0) {
             $sysParams[$k] = $v;
         } else {
             $paramString .= urlencode($k) . '/' . urlencode($v);
         }
     }
     $query = '';
     if (isset($sysParams['_query'])) {
         if ($sysParams['_query'] === '*') {
             $query = \Base::instance()->get('QUERY');
         } elseif (is_array($sysParams['_query'])) {
             $separator = isset($query['_query_arg_separator']) ? $query['_query_arg_separator'] : ini_get('arg_separator.output');
             $encType = isset($query['_query_enc_type']) ? $query['_query_enc_type'] : PHP_QUERY_RFC1738;
             $query = http_build_query($sysParams['_query'], '', $separator, $encType);
         }
     }
     return $this->getBaseUrl($sysParams) . trim($path . '/' . $paramString, '/ ') . ($query ? '?' . $query : '');
 }
开发者ID:nanawel,项目名称:webhomebank,代码行数:28,代码来源:Url.php

示例2: logException

 public function logException(\Exception $e, $file = null)
 {
     if (!$file) {
         $file .= Main::app()->getConfig('EXCEPTION_LOG');
     }
     $message = $e->getCode() . ': ' . $e->getMessage() . "\n" . $e->getTraceAsString();
     self::_log($message, LOG_ERR, $file, false);
 }
开发者ID:nanawel,项目名称:webhomebank,代码行数:8,代码来源:Log.php

示例3: __construct

 public function __construct($name)
 {
     if (!self::$_session) {
         self::$_cacheInstance = new \Cache(Main::app()->getConfig('SESSIONS'));
         self::$_session = new \Session(null, null, self::$_cacheInstance);
     }
     $this->_name = $name;
     $this->_data =& \Base::instance()->ref('SESSION.' . $name);
 }
开发者ID:nanawel,项目名称:webhomebank,代码行数:9,代码来源:Session.php

示例4: getOrderLinkUrl

 /**
  * @param array $currentOrder [order => dir]
  * @param array $newOrder [order => dir]
  * @param string $gridPath
  * @param array $params
  */
 public function getOrderLinkUrl(array $currentOrder, array $newOrder, $gridPath = null, $params = array())
 {
     $orderParam = isset($params['order_param']) ? $params['order_param'] : 'order';
     $dirParam = isset($params['dir_param']) ? $params['dir_param'] : 'dir';
     if ($gridPath === null) {
         $gridPath = '*/*/*';
     }
     $currentOrderKey = key($currentOrder);
     $currentOrderDir = current($currentOrder);
     $newOrderKey = key($newOrder);
     $newOrderDir = current($newOrder);
     if ($newOrderDir === null) {
         if ($currentOrderKey == $newOrderKey) {
             $newOrderDir = $currentOrderDir == SORT_ASC ? SORT_DESC : SORT_ASC;
         } else {
             $newOrderDir = $currentOrderDir;
         }
     }
     $controller = Main::app()->getCurrentController();
     $query = $controller->getRequestQuery();
     $query[$orderParam] = $newOrderKey;
     $query[$dirParam] = $newOrderDir;
     return Url::instance()->getUrl($gridPath, array('_query' => $query));
 }
开发者ID:nanawel,项目名称:webhomebank,代码行数:30,代码来源:Grid.php

示例5: getTheme

 public function getTheme()
 {
     return Main::app()->getConfig('THEME');
 }
开发者ID:nanawel,项目名称:webhomebank,代码行数:4,代码来源:Design.php

示例6: getAvailableCurrencies

 public function getAvailableCurrencies()
 {
     return Main::app()->getConfig('CURRENCIES');
 }
开发者ID:nanawel,项目名称:webhomebank,代码行数:4,代码来源:I18n.php


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