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


PHP V函数代码示例

本文整理汇总了PHP中V函数的典型用法代码示例。如果您正苦于以下问题:PHP V函数的具体用法?PHP V怎么用?PHP V使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: act

 public function act()
 {
     // 添加用例
     if (!$this->check_param('itemid, moduleid, casename, sendtype')) {
         V('Json.Base')->init(Const_Code::CASE_PARAM_ERROR, '用例传递参数错误');
         return;
     }
     $item_id = (int) Util_Server_Request::get_param('itemid', 'post');
     $case_name = trim(Util_Server_Request::get_param('casename', 'post'));
     if (M('Case')->check_name_exists($item_id, $case_name)) {
         V('Json.Base')->init(Const_Code::ADD_CASE_EXISTS, '用例名称重复');
         return;
     }
     M('Case')->insert();
     $case = M('Case')->get_by_name($item_id, $case_name);
     $case_id = (int) $case['id'];
     if (!$case_id) {
         V('Json.Base')->init(Const_Code::ADD_CASE_FAIL, '用例添加失败');
         return;
     }
     $item = M('Item')->get_by_id($item_id);
     $_POST['caseid'] = $case_id;
     $_POST['stepname'] = '调用: ' . $item['name'] . '->' . $case_name;
     $_POST['steptype'] = '接口调用';
     $_POST['stepcommand'] = 'self';
     $_POST['stepvalue'] = $case_id;
     $_POST['stepsequence'] = 1;
     M('Step')->insert();
     V('Json.Base')->init(Const_Code::SUCCESS, $case_id);
 }
开发者ID:universsky,项目名称:lazybug-for-api,代码行数:30,代码来源:add.php

示例2: login

 public function login()
 {
     $smarty = V($this->getController());
     $data['title'] = 'Tieba Cloud - Login';
     $smarty->assign('data', $data);
     $smarty->display('login.html');
 }
开发者ID:quekaihua,项目名称:Mytieba,代码行数:7,代码来源:UserController.class.php

示例3: act

 public function act()
 {
     // 登录流程
     if (!$this->check_param('username, password, issave')) {
         V('Json.Base')->init(Const_Code::LOGIN_PARAM_ERROR, '登录传递参数错误');
         return;
     }
     $username = trim(Util_Server_Request::get_param('username', 'post'));
     $password = trim(Util_Server_Request::get_param('password', 'post'));
     $is_save = (int) Util_Server_Request::get_param('issave', 'post');
     $time = time();
     $seckey = lb_read_system('seckey');
     $user_id = (int) M('User')->check_password($username, md5($username . $password));
     if (!$user_id) {
         V('Json.Base')->init(Const_Code::LOGIN_FAIL, '帐号验证失败');
         return;
     }
     $user = M('User')->get_by_id($user_id);
     $expire_time = $is_save ? 86400 * 30 : 0;
     Util_Client_Cookie::set_cookie('userid', $user_id, $expire_time);
     Util_Client_Cookie::set_cookie('username', $user['name'], $expire_time);
     Util_Client_Cookie::set_cookie('userrole', $user['role'], $expire_time);
     Util_Client_Cookie::set_cookie('time', $time, $expire_time);
     Util_Client_Cookie::set_cookie('secstr', md5($user_id . '$' . $user['name'] . '$' . $user['role'] . '$' . $time . '$' . $seckey), $expire_time);
     V('Json.Base')->init(Const_Code::SUCCESS, '帐号验证通过');
 }
开发者ID:universsky,项目名称:lazybug-for-api,代码行数:26,代码来源:login.php

示例4: act

 public function act()
 {
     // 更新配置
     if (!$this->check_param('configid, packageid, configtype, configkeyword')) {
         V('Json.Base')->init(Const_Code::CONFIG_PARAM_ERROR, '配置传递参数错误');
         return;
     }
     $config_id = (int) Util_Server_Request::get_param('configid', 'post');
     $package_id = (int) Util_Server_Request::get_param('packageid', 'post');
     $config_type = trim(Util_Server_Request::get_param('configtype', 'post'));
     $config_keyword = trim(Util_Server_Request::get_param('configkeyword', 'post'));
     if (!preg_match('/^\\w+$/', $config_keyword)) {
         V('Json.Base')->init(Const_Code::CONFIG_FORMAT_ERROR, '配置关键字格式错误');
         return;
     }
     if (M('Conf')->check_keyword_update($config_id, $package_id, $config_type, $config_keyword)) {
         V('Json.Base')->init(Const_Code::UPDATE_CONFIG_EXISTS, '配置关键字重复');
         return;
     }
     $result = M('Conf')->where('id=' . $config_id)->update();
     if (is_null($result)) {
         V('Json.Base')->init(Const_Code::UPDATE_CONFIG_FAIL, '配置更新失败');
         return;
     }
     V('Json.Base')->init(Const_Code::SUCCESS, '配置更新成功');
 }
开发者ID:universsky,项目名称:lazybug-for-api,代码行数:26,代码来源:update.php

示例5: interface_tests

 protected function interface_tests()
 {
     $this->should->implement('Object should implement ArrayAccess', '', 'ArrayAccess', A());
     $this->should->implement('Object should implement Countable', '', 'Countable', A());
     $this->should->implement('Object should implement JsonSerializable', '', 'JsonSerializable', A());
     // NOTE: Not yet implemented, but should be implemented at some point.
     $this->should->implement('Object should implement Iterator', '', 'Iterator', A());
     $this->should->assert('Calling count() should always return a numeric value', '', function () {
         $a = A(['a' => 0, 'b' => 1, 'c' => 2, 'd' => 3]);
         return is_numeric($a->count());
     });
     $this->should->assert('Calling count() should always return a numeric value', '', function () {
         return is_numeric(A()->count());
     });
     $this->should->assert('Calling empty() should always return a boolean value', '', function () {
         return true === A()->is_empty();
     });
     $this->should->assert('Calling empty() should always return a boolean value', '', function () {
         return false === A(['a' => 1, 'b' => 2, 'c' => 3])->is_empty();
     });
     $this->should->assert('Calling jsonSerialize() should always return an array (the internal storage)', '', function () {
         $a = A(['a' => 1, 'b' => 2, 'c' => 3]);
         return is_array($a->jsonSerialize());
     });
     $this->should->assert('Calling jsonSerialize() should always return an array (the internal storage)', '', function () {
         $a = V();
         return is_array($a->jsonSerialize());
     });
 }
开发者ID:brainsware,项目名称:sauce,代码行数:29,代码来源:Object.php

示例6: act

 public function act()
 {
     // 更新用户密码
     if (!$this->check_param('oldpassword, newpassword')) {
         V('Json.Base')->init(Const_Code::USER_PARAM_ERROR, '用户传递参数错误');
         return;
     }
     $old_password = trim(Util_Server_Request::get_param('oldpassword', 'post'));
     $new_password = trim(Util_Server_Request::get_param('newpassword', 'post'));
     $user_id = (int) $_COOKIE['userid'];
     $user_name = $_COOKIE['username'];
     $old_password = md5($user_name . $old_password);
     $new_password = md5($user_name . $new_password);
     $user = M('User')->get_by_id($user_id);
     if ($old_password !== $user['passwd']) {
         V('Json.Base')->init(Const_Code::USER_CHECK_ERROR, '用户密码校验失败');
         return;
     }
     $_POST['userpassword'] = $new_password;
     $result = M('User')->where('id=' . $user_id)->update();
     if (is_null($result)) {
         V('Json.Base')->init(Const_Code::UPDATE_USER_FAIL, '用户密码更新失败');
         return;
     }
     V('Json.Base')->init(Const_Code::SUCCESS, '用户密码更新成功');
 }
开发者ID:universsky,项目名称:lazybug-for-api,代码行数:26,代码来源:password.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: show

 function show()
 {
     $testModel = M('test');
     $data = $testModel->get();
     $testView = V('test');
     $testView->display($data);
 }
开发者ID:zuofang,项目名称:foo,代码行数:7,代码来源:testController.class.php

示例9: chathistory

 function chathistory()
 {
     $page_num = 10;
     V('db/mongo');
     $db = mongoApi::getInstance('db/mongo_service');
     $clientid = $this->_get('clientid', '');
     $serverid = $this->_get('serverid', '');
     $page = $this->_getid('p', 1);
     if (!empty($clientid) && !empty($serverid)) {
         $ret = $db->table('chats')->find(array("clientid" => $clientid, "serverid" => $serverid), array(), $page_num);
         if (!empty($ret) || count($ret) > 0) {
             $tmp_ret = $ret['contents'];
             $allchats = array();
             foreach ($tmp_ret as $key => $value) {
                 $allchats[$value['time']] = $value;
             }
             krsort($allchats, SORT_NUMERIC);
             $chats = array_slice($allchats, ($page - 1) * $page_num, $page_num);
             $sortedchats = array();
             foreach ($chats as $key => $value) {
                 $sortedchats[$value['time']] = $value;
             }
             ksort($sortedchats, SORT_NUMERIC);
             $this->assign(array("chats" => $sortedchats, "total" => count($ret['contents']), "page" => $page, "pageshow" => $page_num, "servername" => $ret['servername'], "clientname" => $ret['clientname']));
             $this->display();
         } else {
             echo '无聊天记录';
         }
     } else {
         echo 'null';
     }
 }
开发者ID:sdgdsffdsfff,项目名称:51jhome_customerservice,代码行数:32,代码来源:serverolAction.class.php

示例10: index

 public function index()
 {
     $smarty = V($this->getController());
     $data['title'] = 'Tieba Cloud - Install';
     $smarty->assign('data', $data);
     $smarty->display('index.html');
 }
开发者ID:quekaihua,项目名称:Mytieba,代码行数:7,代码来源:InstallController.class.php

示例11: login

 function login()
 {
     $model = M('prof');
     $data = $model->loginGet();
     $view = V('prof');
     $view->displayLogin($data);
 }
开发者ID:huiwei19,项目名称:Tesmudem,代码行数:7,代码来源:profController.class.php

示例12: index

 function index()
 {
     $model = M('user');
     $data = $model->getUsers();
     $view = V('user');
     $view->display($data);
 }
开发者ID:wangsuo2015,项目名称:my,代码行数:7,代码来源:userController.class.php

示例13: errors

 public function errors()
 {
     if (!$this->__errors) {
         $this->__construct_errors();
     }
     return V($this->__errors);
 }
开发者ID:brainsware,项目名称:bacon,代码行数:7,代码来源:Errors.php

示例14: resumeList

 /**
  * 简历列表
  */
 public function resumeList()
 {
     $db = V('resume');
     $db->view = array('user_info' => array('type' => 'inner', 'on' => 'resume.uid=user_info.uid', 'field' => 'name'));
     $cond = array();
     if (isset($_GET['resume_name'])) {
         $cond[] = 'resume_name like "%' . $_GET['resume_name'] . '%"';
     }
     if (isset($_GET['name'])) {
         $cond[] = 'name like "%' . $_GET['name'] . '%"';
     }
     if (isset($_GET['created'])) {
         $cond['created'] = array('gt' => strtotime($_GET['created']), 'lt' => time());
     }
     if (isset($_GET['updated'])) {
         $cond['updated'] = array('gt' => strtotime($_GET['updated']), 'lt' => time());
     }
     if (isset($_GET['verify'])) {
         $cond['verify'] = $_GET['verify'];
     }
     $nums = $db->where($cond)->count();
     $page = new page($nums, 13);
     $resumes = $db->where($cond)->findall($page->limit());
     $this->assign('resumes', $resumes);
     $this->assign('page', $page->show());
     $this->display();
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:30,代码来源:resumeControl.php

示例15: check_api_auth

 public function check_api_auth()
 {
     // 接口授权检查
     if (!$this->check_auth()) {
         V('Json.Base')->init(Const_Code::AUTH, '授权限制');
         exit;
     }
 }
开发者ID:universsky,项目名称:lazybug-for-api,代码行数:8,代码来源:base.php


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