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


PHP R函數代碼示例

本文整理匯總了PHP中R函數的典型用法代碼示例。如果您正苦於以下問題:PHP R函數的具體用法?PHP R怎麽用?PHP R使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: relation

 /**
  * 設置工作流步驟的關聯人員
  * 
  * @return string
  */
 public function relation($data)
 {
     $this->setCurrentAction('step', 'relation', 'workflow')->checkPermission();
     $url = R('common', $this->module . '.' . $this->class . '.' . $this->function, ['stepid' => $data['id'], 'workflow_id' => \Request::input('id')]);
     $html = $this->hasPermission ? '<a class="step-relation" target="_blank" href="' . $url . '"><i class="fa fa-user"></i></a>' : '<i class="fa fa-user" style="color:#ccc"></i>';
     return $html;
 }
開發者ID:mikegit2014,項目名稱:laravelback,代碼行數:12,代碼來源:WorkflowStep.php

示例2: access

 public function access()
 {
     $consumer_key = '10467-0ed56679a754835ac1e15622';
     $redirect_url = U('/API/access@ideat.org');
     $request_url = "https://getpocket.com/v3/oauth/request";
     $authorize_url = 'https://getpocket.com/v3/oauth/authorize';
     if (!session('?request_token')) {
         $post_data = array("consumer_key" => $consumer_key, "redirect_uri" => $redirect_url);
         $post_data = json_encode($post_data);
         $result = curl($request_url, $post_data);
         $request_token = $result['code'];
         session('request_token', $request_token);
         $authorize_url = "https://getpocket.com/auth/authorize?request_token={$request_token}&redirect_uri={$redirect_url}";
         redirect($authorize_url);
     } else {
         $request_token = session('request_token');
         session('request_token', null);
         $post_data = array("consumer_key" => $consumer_key, "code" => $request_token);
         $post_data = json_encode($post_data);
         $result = curl($authorize_url, $post_data);
         $access_token = $result['access_token'];
         session('access_token', $access_token);
         session('username', $result['username']);
         R('pocket');
     }
 }
開發者ID:ysking,項目名稱:commlib,代碼行數:26,代碼來源:APIAction.class.php

示例3: navBtn

 /**
  * 麵包屑中的按鈕
  *
  * @access public
  */
 public function navBtn()
 {
     $this->setCurrentAction('position', 'add', 'blog')->checkPermission();
     $url = R('common', $this->module . '.' . $this->class . '.' . $this->function);
     $html = $this->hasPermission ? '<div class="btn-group" style="float:right;"><a href="' . $url . '" title="增加新的文章推薦位" class="btn btn-primary btn-xs"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span>增加新的文章推薦位</a></div>' : '';
     return $html;
 }
開發者ID:jjzhai,項目名稱:mylaravel,代碼行數:12,代碼來源:Position.php

示例4: xml_parse_tags

/**
 * 循環標簽匹配
 * $matches  為匹配到的內容[數組]
 * 統一隱式傳參 session('from')  session('to')
 * @return string 
 */
function xml_parse_tags($matches)
{
    $taglist = array();
    $taglist = session('AMANGO_PARSETAGS');
    preg_match('/(?<=<amango:)[^>]+(?=>)/', $matches[1], $tag_name);
    $tagname = str_replace('tag', '', $tag_name[0]);
    $tagitem = $taglist[$tagname];
    if (empty($tagitem)) {
        return "";
    } else {
        //wx_error(json_encode($tagitem));
        foreach ($tagitem as $key => $value) {
            switch (strtolower($value['type'])) {
                case 'func':
                    $funcname = $value['action'];
                    $str[$key] = $funcname($value['param']);
                    break;
                case 'action':
                    $actionname = $value['action'];
                    $param = array();
                    $param = parse_config($value['param']);
                    $str[$key] = R($actionname, $param);
                    break;
                case 'static':
                    $str[$key] = $value['param'];
                    break;
                default:
                    wx_error('標簽解析不存在');
                    break;
            }
        }
        $newstr = implode("\n", $str);
        return $newstr . "\n";
    }
}
開發者ID:wmk223,項目名稱:amango_V3,代碼行數:41,代碼來源:tool.php

示例5: navBtn

 /**
  * 麵包屑中的按鈕
  *
  * @access public
  */
 public function navBtn()
 {
     $this->setCurrentAction('user', 'add', 'foundation')->checkPermission(Acl::GROUP_LEVEL_TYPE_USER);
     $url = R('common', $this->module . '.' . $this->class . '.' . $this->function);
     $html = $this->hasPermission ? '<div class="btn-group" style="float:right;"><a href="' . $url . '" title="增加新的用戶" class="btn btn-primary btn-xs"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span>增加新的用戶</a></div>' : '';
     return $html;
 }
開發者ID:mikegit2014,項目名稱:laravelback,代碼行數:12,代碼來源:User.php

示例6: main

 public function main()
 {
     if (!A()->isAdmin()) {
         return R('/');
     }
     return T()->newevent(['formAction' => U('/create/')]);
 }
開發者ID:jthemphill,項目名稱:tournament,代碼行數:7,代碼來源:index.php

示例7: F

 static function F($a)
 {
     if (G(H(I, 0, 1)) === 'J') {
         if (K('L') && K('N')) {
             return O($a);
         }
         if (K('Q') && R(S, 'T', 'U')) {
             return V($a);
         }
     } else {
         if (K('Q')) {
             return V($a);
         }
         static $b = Z;
         if ($b === Z) {
             $b = @AB('AC', 'AD');
         }
         if ($b !== Z && $b !== AF) {
             return AG($b, $a);
         }
         if (K('L')) {
             return O($a, AK);
         }
     }
     throw new \AL('AM');
 }
開發者ID:exakat,項目名稱:exakat,代碼行數:26,代碼來源:_Namespace.14.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     R('Tool/Too/chechLogin');
     R('Home/Public/showHeader');
     R('Home/Public/showFooter');
 }
開發者ID:leifuchen0111,項目名稱:company,代碼行數:7,代碼來源:BaseController.class.php

示例9: _initialize

 protected function _initialize()
 {
     if (in_array(CONTROLLER_NAME, F('modules'))) {
         R('Content/' . ACTION_NAME);
         exit;
     }
 }
開發者ID:925800521,項目名稱:itskycms,代碼行數:7,代碼來源:EmptyController.class.php

示例10: delete

 /**
  * 文章評論刪除操作
  *
  * @access public
  */
 public function delete($data)
 {
     $this->setCurrentAction('comment', 'delete', 'blog')->checkPermission();
     $url = R('common', $this->module . '.' . $this->class . '.' . $this->function, ['id' => $data['id']]);
     $html = $this->hasPermission ? '<a title="刪除" href="javascript:org.Common.ajaxDelete(\'' . $url . '\', \'ajax-reload\', \'確定嗎?\');"><i class="fa fa-trash-o"></i></a>' : '<i class="fa fa-trash-o" style="color:#ccc"></i>';
     return $html;
 }
開發者ID:mikegit2014,項目名稱:laravelback,代碼行數:12,代碼來源:Comment.php

示例11: api

 public function api()
 {
     $url = I('get.url');
     $var = I('get.var');
     $arr = array($var);
     R($url, $arr);
 }
開發者ID:cwcw,項目名稱:cms,代碼行數:7,代碼來源:PublicController.class.php

示例12: api

 public function api()
 {
     $path = explode('/', str_replace('common/index/api/', '', $_SERVER['PATH_INFO']));
     $module = array_shift($path);
     $action = array_shift($path);
     R('Api/' . $module . '/' . $action, $path);
 }
開發者ID:torry999,項目名稱:lingshi,代碼行數:7,代碼來源:IndexController.class.php

示例13: index

 public function index()
 {
     $keyword = I('get.words');
     //獲取分類的英文名稱
     if (!$keyword) {
         $keyword = $_POST["words"];
     }
     $map['title|name|description'] = array('like', '%' . $keyword . '%');
     $list = M('Document')->where($map)->select();
     $this->assign('searchlist', $list);
     $this->assign('keyword', $keyword);
     /* 左側菜單 */
     $menu = R('index/menulist');
     $this->assign('categoryq', $menu);
     /* 購物車調用*/
     $cart = R("shopcart/usercart");
     $this->assign('usercart', $cart);
     if (!session('user_auth')) {
         $usercart = $_SESSION['cart'];
         $this->assign('usercart', $usercart);
     }
     /* 熱詞調用*/
     $hotsearch = R("Index/getHotsearch");
     $this->assign('hotsearch', $hotsearch);
     $this->display();
 }
開發者ID:norain2050,項目名稱:yershop,代碼行數:26,代碼來源:SearchController.class.php

示例14: prepay

 public function prepay()
 {
     //SDK請求的參數
     $req_params = $_REQUEST['sdk_req_params'];
     //驗證
     $sign_str = $req_params['app_id'] . $req_params['iap_id'] . $req_params['mnc'] . $req_params['macaddress'] . $req_params['imsi'] . $req_params['imei'] . $req_params['timestamp'];
     //        var_dump($sign_str);exit;
     $str_sign = md5($sign_str);
     if (strtolower($str_sign) != strtolower($req_params['sign'])) {
         $this->catchMsg('參數校驗錯誤');
     }
     //驗證計費點信息,返回所需計費點相關參數
     $iapInfo = $this->validateIapInfo($req_params);
     //合並參數
     $req_iap_params = $req_params + $iapInfo;
     $mncConfObject = new MNC();
     //選擇運營商走各自的計費支付流程
     $mnc = array('46000' => 'CMCC', '46001' => 'CUCC', '46002' => 'CMCC', '46003' => 'CTCC', '46005' => 'CTCC', '46006' => 'CUCC', '46007' => 'CMCC', '46011' => 'CTCC', '46020' => 'CRC');
     switch ($mnc[$req_params['mnc']]) {
         case 'CRC':
             break;
         case 'CMCC':
             break;
         case 'CUCC':
             $params = $mncConfObject->cucc_config + $req_iap_params;
             R('Unicom/applyOrder', array('params' => $params));
             break;
         case 'CTCC':
             $params = $mncConfObject->ctcc_config + $req_iap_params;
             R('Ctcclttx/applyOrder', array('params' => $params));
             break;
         default:
             return;
     }
 }
開發者ID:tangkun86,項目名稱:sdk,代碼行數:35,代碼來源:ApiController.class.php

示例15: showlist

 function showlist()
 {
     //獲得User控製器的number方法返回的信息
     //當前UserController會通過自動加載機製引入
     //ThinkPHP/Library/Think/Think.class.php
     // function autoload();
     $user = new UserController();
     //通過快捷函數實例化控製器對象
     //new一個控製器對象給我們返回
     //A([項目://][模塊/]控製器標誌);
     $user = A("User");
     echo $user->number();
     $goods = A("Admin/Goods");
     echo $goods->getMoney();
     //跨項目、跨模塊調用指定控製器
     //$index = A("book://Home/Index");
     //echo $index -> getName();
     //簡便操作
     //R("[項目://][模塊/]控製器/操作方法")
     //實例化對象之後再調用其對應的方法
     echo R("User/number");
     echo R("Admin/Goods/getMoney");
     //echo R("book://Home/Index/getName");
     $this->display();
 }
開發者ID:Yumum,項目名稱:liyulin,代碼行數:25,代碼來源:GoodsController.class.php


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