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


PHP F函數代碼示例

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


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

示例1: __construct

 function __construct($modelid, $catid = 0, $categorys = array())
 {
     $this->modelid = $modelid;
     $this->catid = $catid;
     $this->categorys = $categorys;
     $this->fields = F("Model_field_" . $modelid);
 }
開發者ID:BGCX262,項目名稱:ztoa-svn-to-git,代碼行數:7,代碼來源:content_output.class.php

示例2: friend

 /**
  * 主頁
  */
 public function friend()
 {
     //獲取好友列表
     $mfriend_list = F('mfriend_list' . $this->qq['qq']);
     $mfriend_list = null;
     if (!unserialize($mfriend_list)) {
         $url = "http://r.cnc.qzone.qq.com/cgi-bin/tfriend/friend_mngfrd_get.cgi?uin=" . $this->qq['qq'] . "&rd=" . rand(1, 999) . "&g_tk=" . $this->qq['gtk'];
         $result = $this->sendToQq($url);
         $result = $this->filterCallback($result);
         $results = json_decode($result);
         F('mfriend_list' . $this->qq['qq'], serialize($results));
     } else {
         $results = unserialize($mfriend_list);
     }
     $datas = $results->items;
     $gpnames = $results->gpnames;
     //存儲相關數據
     //F('fl_' . $this->qq['qq'], $results);
     $this->groud = $gpnames;
     //$this->autoZantask = F('zan_lock_' . $this->qq['qq']);
     //$this->autoCommtask = F('comm_lock_' . $this->qq['qq']);
     //設置cookie
     $this->assign("qq", $this->qq['qq']);
     $this->assign("groud", $gpnames);
     $this->assign("data", $datas);
     $this->display();
 }
開發者ID:jayxtt999,項目名稱:shuoshuo,代碼行數:30,代碼來源:HomeController.class.php

示例3: cate

 /**
  * 專輯分類
  * 如果用戶傳入了非默認field,order則直接查詢數據庫,所以不推薦傳入這些參數
  * @param array $options 
  */
 public function cate($options)
 {
     $options['field'] = isset($options['field']) ? trim($options['field']) : '*';
     $options['where'] = isset($options['where']) ? trim($options['where']) : '';
     $options['num'] = isset($options['num']) ? intval($options['num']) : 0;
     $options['order'] = isset($options['order']) ? trim($options['order']) : 'ordid';
     if ($options['field'] != '*' || $options['where'] || $options['order'] != 'ordid') {
         $album_cate_mod = M('album_cate');
         $map = array('status' => '1');
         $select = $album_cate_mod->field($options['field']);
         //字段
         $options['where'] && ($map['_string'] = $options['where']);
         $select->where($map);
         //條件
         $options['num'] && $select->limit($options['num']);
         //個數
         $select->order($options['order']);
         //排序
         $data = $select->select();
     } else {
         //分類緩存
         if (false === ($cate_list = F('album_cate_list'))) {
             $cate_list = D('album_cate')->cate_cache();
         }
         $options['num'] && ($cate_list = array_slice($cate_list, 0, $options['num']));
         $data = $cate_list;
     }
     return $data;
 }
開發者ID:dlpc,項目名稱:weixin_shop,代碼行數:34,代碼來源:albumTag.class.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->assign('controller', CONTROLLER_NAME);
     //讀取配置信息
     $web_stting = F('setting');
     if ($web_stting === false) {
         $params = array();
         $list = M('Setting')->getField('name,value');
         foreach ($list as $key => $val) {
             $params[$key] = unserialize($val) ? unserialize($val) : $val;
         }
         F('setting', $params);
         $web_stting = F('setting');
     }
     $this->web_stting = $web_stting;
     //站點狀態判斷
     if ($this->web_stting['site_status'] != 1) {
         echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
         echo $this->web_stting['closed_reason'];
         exit;
     } else {
         $this->assign('seo', seo());
     }
     //檢查登錄
     /* session('member_id',null);
     		if(!session('member_id'))
     		{
     			$this->wx_auto_login(); //自動登錄	
     		}
     		$this->mid = session('member_id'); */
     $this->mid = 10;
     $this->m_info = M('Member')->where('member_id=' . $this->mid)->find();
 }
開發者ID:noikiy,項目名稱:baomihua,代碼行數:34,代碼來源:WechatController.class.php

示例5: update_cache

 public function update_cache()
 {
     //獲得表中的所有欄目數據
     $category = Data::tree($this->all(), 'cname');
     return F("category", $category);
     //file_put_contents()儲存文件緩存
 }
開發者ID:jyht,項目名稱:v5,代碼行數:7,代碼來源:CategoryModel.class.php

示例6: __construct

 /**
  * 構造函數
  */
 public function __construct()
 {
     /**
      * 驗證圈子是否開啟
      */
     if (C('circle_isuse') != '1') {
         @header('location: ' . SHOP_SITE_URL);
         die;
     }
     /**
      * 讀取通用、布局的語言包
      */
     Language::read('common');
     /**
      * 設置布局文件內容
      */
     Tpl::setLayout('circle_layout');
     /**
      * 查詢是否是超管
      */
     $this->checkSuper();
     /**
      * 獲取導航
      */
     Tpl::output('nav_list', ($nav = F('nav')) ? $nav : rkcache('nav', true, 'file'));
 }
開發者ID:uwitec,項目名稱:xbshop,代碼行數:29,代碼來源:control.php

示例7: G

function G()
{
    static $myvar = 4;
    echo "{$myvar} ";
    echo F();
    echo "{$myvar}";
}
開發者ID:badlamer,項目名稱:hhvm,代碼行數:7,代碼來源:011.php

示例8: index

 public function index()
 {
     //URL規則
     $urlrules = F('urlrules');
     $where = array();
     if (isset($_GET['tagid'])) {
         $where['tagid'] = array("EQ", (int) $this->_get("tagid"));
         $r = M("Tags")->where($where)->find();
         $where['tag'] = $r['tag'];
         unset($where['tagid']);
     } else {
         $where['tag'] = array("EQ", $this->_get("tag"));
     }
     $data = M("Tags")->where($where)->find();
     if (!$data) {
         $this->error("該Tag不存在!");
     }
     $this->assign($data);
     M("Tags")->where($where)->setInc("hits");
     M("Tags")->where($where)->save(array("lasthittime" => time()));
     $page = $this->_get(C("VAR_PAGE"));
     $this->assign("page", $page);
     $urlrules = $urlrules[CONFIG_TAGURL];
     define('URLRULE', str_replace('|', '~', str_replace(array('{$tag}', '{$tagid}'), array($this->_get('tag'), (int) $this->_get("tagid")), $urlrules)));
     $SEO = seo();
     //seo分配到模板
     $this->assign("SEO", $SEO);
     //把分頁分配到模板
     $this->assign(C("VAR_PAGE"), $page);
     $this->display("Tags:tag");
 }
開發者ID:BGCX262,項目名稱:ztoa-svn-to-git,代碼行數:31,代碼來源:IndexAction.class.php

示例9: _initialize

 /**
  * 係統初始化方法
  *
  * @access protected
  */
 protected function _initialize()
 {
     header("Content-type:text/html;charset=utf-8");
     Load('extend');
     $this->ajax = $this->IS_AJAX;
     $this->post = strtolower($_SERVER['REQUEST_METHOD']) == 'post';
     $this->ip = get_client_ip();
     $this->timestamp = time();
     $this->root_path = dirname($_SERVER['PHP_SELF']);
     $this->root_path = $this->root_path == '\\' || $this->root_path == '/' ? '' : $this->root_path;
     define('__ROOT_PATH__', $this->root_path);
     C('TMPL_PARSE_STRING.__ROOT_PATH__', __ROOT_PATH__);
     $this->site_cfg = F('site_cfg');
     $this->assign('site_cfg', $this->site_cfg);
     define('__TPL_PATH__', '/Application/Home/View');
     C('TMPL_PARSE_STRING.__TPL_PATH__', __TPL_PATH__);
     $this->upload_dir = $this->root_path . '/upload/';
     define('__UPLOAD_PATH__', $this->upload_dir);
     C('TMPL_PARSE_STRING.__UPLOAD_PATH__', __UPLOAD_PATH__);
     // 如果當前用戶驗證身份cookie有效則獲取相用戶信息
     $_SESSION['auth'] = isset($_SESSION['auth']) ? $_SESSION['auth'] : '';
     if ($_SESSION['auth'] != '' && $this->validAuthCookie()) {
         C('formtoken_extra', $this->user['mid'] . $this->user['password']);
     }
     if (method_exists($this, '_init')) {
         $this->_init();
     }
 }
開發者ID:yudawei1230,項目名稱:node,代碼行數:33,代碼來源:FrontController.class.php

示例10: updateVerify

 public function updateVerify()
 {
     //verify配置文件源碼
     /*//驗證碼長度
     'VERIFY_LENGTH' => '2', 
     //驗證碼圖片寬度(像素)
     'VERIFY_WIDTH' => '100', 
     //驗證碼圖片高度(像素
     'VERIFY_HEIGHT' => '35', 
     //驗證碼背影顏色(16進製色值
     'VERIFY_BGCOLOR' => '#ffffff',
     //驗證碼種子
     'VERIFY_SEED' => '3456789aAbBcCdDeEfFgGhHjJkKmMnNpPqQrRsStTuUvVwWxXyY',
     //驗證碼字體文件
     'VERIFY_FONTFILE' => './Data/font.ttf',
     //驗證碼字體大小
     'VERIFY_SIZE' => '25', 
     //驗證碼字體顏色(16進製色值)
     'VERIFY_COLOR' => '#444', 
     //SESSION識別名稱
     'VERIFY_NAME' => 'verify', 
     //存儲驗證碼到SESSION時使用函數
     'VERIFY_FUNC' => 'strtolower', */
     if (F('verify', $_POST, CONF_PATH)) {
         $this->SUCCESS('修改成功', U(GROUP_NAME . '/System/verify'));
     } else {
         $this->error('修改失敗' . CONF_PATH . 'verify.php權限');
     }
 }
開發者ID:bthtml,項目名稱:btnav,代碼行數:29,代碼來源:SystemAction.class.php

示例11: testBack

 public function testBack()
 {
     $arrays = ['a', 'b', 'c', 'd'];
     $expect = ['c', 'd'];
     $actual = F()->back(2, $arrays)->call();
     $this->assertEquals($expect, $actual);
 }
開發者ID:projx-io,項目名稱:fluent,代碼行數:7,代碼來源:ArrayTest.php

示例12: edit

 public function edit()
 {
     if (IS_POST) {
         $db = D("Domains");
         $data = $db->create();
         if ($data) {
             $status = $db->editDomains($data);
             if ($status !== false) {
                 $this->success("編輯成功,請及時更新緩存!");
                 F("Domains_list", null);
             } else {
                 $this->error("編輯失敗!");
             }
         } else {
             $this->error($db->getError());
         }
     } else {
         $db = M("Domains");
         $id = (int) $this->_get("id");
         $info = $db->where(array("id" => $id))->find();
         if (!$info) {
             $this->error("該信息不存在!");
         }
         $this->assign($info);
         $this->display();
     }
 }
開發者ID:BGCX262,項目名稱:ztoa-svn-to-git,代碼行數:27,代碼來源:DomainsAction.class.php

示例13: __construct

 function __construct($modelid, $id)
 {
     $this->modelid = $modelid;
     $this->fields = F("Model_field_" . $modelid);
     $this->id = $id;
     load("@.treatfun");
 }
開發者ID:BGCX262,項目名稱:ztoa-svn-to-git,代碼行數:7,代碼來源:content_update.class.php

示例14: testIfFalse

 public function testIfFalse()
 {
     $person = (object) ['gender' => 'male'];
     $expect = 'Woman';
     $actual = F($person)->if(F()->gender->equalTo('male')->not(), F('Man'), F('Woman'))->call();
     $this->assertEquals($expect, $actual);
 }
開發者ID:projx-io,項目名稱:fluent,代碼行數:7,代碼來源:FlowTest.php

示例15: _assign_oauth

 /**
  * 第三方登陸模塊
  */
 private function _assign_oauth()
 {
     if (false === ($oauth_list = F('oauth_list'))) {
         $oauth_list = D('oauth')->oauth_cache();
     }
     $this->assign('oauth_list', $oauth_list);
 }
開發者ID:dlpc,項目名稱:weixinshop,代碼行數:10,代碼來源:frontendAction.class.php


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