• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP go函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: refer

 public function refer()
 {
     //获取系统菜单
     $menu = service('menu')->menus();
     $cur = current($menu);
     go(__ROOT__ . $cur['url']);
 }
开发者ID:houdunwang,项目名称:hdcms,代码行数:7,代码来源:Entry.php


示例2: run

 /**
  * 运行钓子
  *
  * @param $options
  */
 public function run(&$options)
 {
     //检测安装
     if (!file_exists(APP_PATH . 'Install/Lock.php')) {
         if (MODULE != 'Install') {
             go(__ROOT__ . '/index.php?m=Install&c=Index&a=index');
         }
     } else {
         if (session('user')) {
             //登录
             define('IS_LOGIN', true);
             //管理员
             define('IS_ADMIN', $_SESSION['user']['admin'] == 1);
             //超级管理员
             define('IS_SUPER_ADMIN', $_SESSION['user']['rid'] == 1);
             //站长
             define('IS_WEBMASTER', strtoupper($_SESSION['user']['username']) == strtoupper(C('WEB_MASTER')));
         } else {
             //登录
             define('IS_LOGIN', false);
             //管理员
             define('IS_ADMIN', false);
             //超级管理员
             define('IS_SUPER_ADMIN', false);
             //站长
             define('IS_WEBMASTER', false);
         }
         //加载插件
         $this->loadAddons();
     }
 }
开发者ID:suhanyujie,项目名称:spider,代码行数:36,代码来源:AppInitHook.class.php


示例3: index

 public function index()
 {
     if (site()->users()->count() > 0) {
         go(panel()->urls()->login());
     }
     if ($problems = installation::check()) {
         $content = view('installation/check', array('problems' => $problems));
     } else {
         $form = panel()->form('installation', array('language' => kirby()->option('panel.language', 'en')));
         $form->cancel = false;
         $form->save = l('installation.signup.button');
         $form->centered = true;
         foreach (panel()->languages() as $lang) {
             $form->fields()->get('language')->options[$lang->code()] = $lang->title();
         }
         $form->on('submit', function ($form) {
             try {
                 // fetch all the form data
                 $data = $form->serialize();
                 // make sure that the first user is an admin
                 $data['role'] = 'admin';
                 // try to create the new user
                 $user = panel()->site()->users()->create($data);
                 // store the new username for the login screen
                 s::set('username', $user->username());
                 // redirect to the login
                 go(panel()->urls()->login() . '/welcome');
             } catch (Exception $e) {
                 $form->alert($e->getMessage());
             }
         });
         $content = view('installation/signup', array('form' => $form));
     }
     return layout('installation', array('meta' => new Snippet('meta'), 'content' => $content));
 }
开发者ID:aoimedia,项目名称:kosmonautensofa,代码行数:35,代码来源:installation.php


示例4: __construct

 public function __construct($kirby, $dir)
 {
     static::$instance = $this;
     $this->kirby = $kirby;
     $this->site = $kirby->site();
     $this->roots = new Panel\Roots($dir);
     $this->urls = new Panel\Urls($kirby->urls()->index() . '/' . basename($dir));
     $this->load();
     // load all available routes
     $this->routes = array_merge($this->routes, require $this->roots->routes . DS . 'api.php');
     $this->routes = array_merge($this->routes, require $this->roots->routes . DS . 'views.php');
     // setup the blueprint root
     blueprint::$root = $this->kirby->roots()->blueprints();
     // setup the form plugin
     form::setup($this->roots->fields, $this->kirby->roots()->fields());
     // start the router
     $this->router = new Router($this->routes);
     // register router filters
     $this->router->filter('auth', function () use($kirby) {
         $user = $kirby->site()->user();
         if (!$user or !$user->hasPanelAccess()) {
             if ($user) {
                 $user->logout();
             }
             go('panel/login');
         }
     });
     // check for a completed installation
     $this->router->filter('isInstalled', function () use($kirby) {
         if ($kirby->site()->users()->count() == 0) {
             go('panel/install');
         }
     });
 }
开发者ID:DerZyklop,项目名称:gutesache.pxwrk.de,代码行数:34,代码来源:panel.php


示例5: lists

 public function lists()
 {
     if (!isset($_SESSION['user']['user_id'])) {
         go('Home/User/login');
     }
     //分配模板文件配置
     $tplData['title'] = "购物车";
     $tplData['css'] = "cart|order";
     View::with('tplData', $tplData);
     //购物车列表信息
     $cart = $_SESSION['cart'];
     $price = 0;
     foreach ($cart as $k => $v) {
         $cart[$k]['goods'] = Db::table('goods')->where('goods_id', $v['goods_id'])->first();
         $attrs = explode('-', $v['stock_attr']);
         foreach ($attrs as $key => $value) {
             $attrs[$key] = Db::table('goods_attr')->where('goods_attr_id', $value)->first();
             $attrs[$key]['attr_name'] = Db::table('shop_attr')->where('attr_id', $attrs[$key]['attr_id'])->pluck('attr_name');
         }
         $cart[$k]['attr'] = $attrs;
         $price += $v['goods_price'] * $v['buy_num'];
         //总价
     }
     View::with('cart', $cart);
     View::with('price', $price);
     //收货地址列表
     $address = new \Home\Model\Address();
     $addressData = $address->getAll();
     View::with('addressData', $addressData);
     // p($addressData);
     View::make($this->tpl . 'order.html');
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:32,代码来源:OrderController.php


示例6: checkAccess

 public function checkAccess()
 {
     //未登录
     if (!IS_LOGIN) {
         go(U("Member/Login/login"));
     }
     //状态
     if (!USER_STATE) {
         $this->error('帐号审核中...');
     }
     //锁定
     if (IS_LOCK) {
         $this->error('帐号已锁定...');
     }
     //管理员
     if (WEB_MASTER || IN_ADMIN) {
         return true;
     }
     //会员中心关闭
     if (C("MEMBER_OPEN") == 0) {
         $this->display("template/system/member_close.html");
         exit;
     }
     //邮箱验证
     if (C('MEMBER_EMAIL_VALIDATE') && $_SESSION['user_state'] == 0) {
         go(U('Member/Email/VaifyMail'));
     }
     return true;
 }
开发者ID:jyht,项目名称:v5,代码行数:29,代码来源:MemberAuthControl.class.php


示例7: logout

 public function logout()
 {
     if ($user = app::$site->user()) {
         $user->logout();
     }
     go('panel/login');
 }
开发者ID:kompuser,项目名称:panel,代码行数:7,代码来源:auth.php


示例8: logout

 public function logout()
 {
     if ($user = panel()->site()->user()) {
         $user->logout();
     }
     go(panel()->urls()->login());
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:7,代码来源:auth.php


示例9: get_info

 /**
  * 获取评论信息
  * @param $module      模型
  * @param $contentid   文章ID
  * @param $siteid      站点ID
  */
 function get_info($module, $contentid, $siteid)
 {
     list($module, $catid) = explode('_', $module);
     if (empty($contentid) || empty($catid)) {
         return false;
     }
     //判断栏目是否存在 s
     $CATEGORYS = getcache('category_content_' . $siteid, 'commons');
     if (!$CATEGORYS[$catid]) {
         return false;
     }
     //判断模型是否存在
     $this_modelid = $CATEGORYS[$catid]['modelid'];
     $MODEL = getcache('model', 'commons');
     if (!$MODEL[$this_modelid]) {
         return false;
     }
     $this->db->set_catid($catid);
     $r = $this->db->get_one(array('catid' => $catid, 'id' => $contentid), '`title`');
     $category = getcache('category_content_' . $siteid, 'commons');
     $model = getcache('model', 'commons');
     $cat = $category[$catid];
     $data_info = array();
     if ($cat['type'] == 0) {
         if ($model[$cat['modelid']]['tablename']) {
             $this->db->table_name = $this->db->db_tablepre . $model[$cat['modelid']]['tablename'] . '_data';
             $data_info = $this->db->get_one(array('id' => $contentid));
         }
     }
     if ($r) {
         return array('title' => $r['title'], 'url' => go($catid, $contentid, 1), 'allow_comment' => isset($data_info['allow_comment']) ? $data_info['allow_comment'] : 1);
     } else {
         return false;
     }
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:41,代码来源:comment_api.class.php


示例10: __init

 public function __init()
 {
     if (empty($_SESSION['user'])) {
         go("Index/Index/index");
     }
     $this->db = M('upload');
 }
开发者ID:lililishuang,项目名称:hdcms,代码行数:7,代码来源:ContentUploadController.class.php


示例11: category

 public function category()
 {
     $mid = Q('mid', 0, 'intval');
     $cid = Q('cid', 0, 'intval');
     $cache = cache('category');
     if (!$mid || !$cid || !isset($cache[$cid])) {
         _404();
     }
     $cachetime = C('CACHE_CATEGORY') >= 1 ? C('CACHE_CATEGORY') : null;
     if (!$this->isCache()) {
         $category = $cache[$cid];
         //外部链接,直接跳转
         if ($category['cattype'] == 3) {
             go($category['cat_redirecturl']);
         } else {
             $Model = ContentViewModel::getInstance($category['mid']);
             $catid = getCategory($category['cid']);
             $category['content_num'] = $Model->join()->where("cid IN(" . implode(',', $catid) . ")")->count();
             $category['comment_num'] = intval(M('comment')->where("cid IN(" . implode(',', $catid) . ")")->count());
             $this->assign("hdcms", $category);
             $this->display($category['template'], $cachetime);
         }
     } else {
         $this->display(null, $cachetime);
     }
 }
开发者ID:jyht,项目名称:v5,代码行数:26,代码来源:IndexControl.class.php


示例12: checkAdminAccess

 /**
  * 后台权限验证
  *
  * @return bool
  */
 protected function checkAdminAccess()
 {
     //没登录或普通用户
     if (!IS_ADMIN) {
         go("Login/login");
     }
     /**
      * 超级管理员与站长不受限制
      */
     if (IS_SUPER_ADMIN || IS_WEB_MASTER) {
         return true;
     }
     /**
      * 普通管理员权限检查
      */
     $nodeModel = M("node");
     $nodeModel->where = array("MODULE" => MODULE, "controller" => CONTROLLER, "action" => ACTION, 'type' => 1);
     $node = $nodeModel->field("nid")->find();
     /**
      * 当节点不存时,表示不需要验证
      * 这时直接允许操作
      */
     if (!$node) {
         return true;
     } else {
         $map['nid'] = $node['nid'];
         $map['rid'] = $_SESSION['user']['rid'];
         return M('access')->where($map)->find();
     }
 }
开发者ID:suhanyujie,项目名称:spider,代码行数:35,代码来源:AuthController.class.php


示例13: __construct

 public function __construct()
 {
     if (!session('user')) {
         go('Login/login');
     }
     parent::__construct();
 }
开发者ID:lililishuang,项目名称:hdcms,代码行数:7,代码来源:AuthController.class.php


示例14: __construct

 public function __construct()
 {
     if (!$_SESSION['user_id']) {
         go('Login/index');
     }
     parent::__construct();
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:7,代码来源:Controller.php


示例15: login

 public function login()
 {
     if (session('aid')) {
         go("Index/index");
     }
     if (IS_POST) {
         $username = Q("post.username");
         //对登录帐号的验证
         if (!($user = $this->_db->where("username='{$username}'")->find())) {
             $this->error('帐号输入错误');
         }
         //对密码的验证
         if ($user['password'] != md5($_POST['password'])) {
             $this->error('密码输入错误');
         }
         //当帐号密码输入正确时记录登录状态
         $_SESSION['aid'] = $user['aid'];
         $_SESSION['username'] = $user['username'];
         //跳转到后台界面
         go('Index/index');
     } else {
         //显示登录界面
         $this->display();
     }
 }
开发者ID:jyht,项目名称:v5,代码行数:25,代码来源:LoginControl.class.php


示例16: index

 public function index()
 {
     if (app::$site->users()->count() > 0) {
         go('panel/login');
     }
     if ($problems = installation::check()) {
         $content = view('installation/check', array('problems' => $problems));
     } else {
         $form = app::form('installation', array('language' => c::get('panel.language', 'en')));
         $form->cancel = false;
         $form->save = l::get('installation.signup.button');
         $form->centered = true;
         foreach (app::languages() as $lang) {
             $form->fields()->get('language')->options[$lang->code()] = $lang->title();
         }
         $form->on('submit', function ($form) {
             try {
                 app::$site->users()->create($form->serialize());
                 go('panel/login/welcome');
             } catch (Exception $e) {
                 $form->alert($e->getMessage());
             }
         });
         $content = view('installation/signup', array('form' => $form));
     }
     return layout('installation', array('meta' => new Snippet('meta'), 'content' => $content));
 }
开发者ID:kompuser,项目名称:panel,代码行数:27,代码来源:installation.php


示例17: get_info

 /**
  * 获取评论信息
  * @param $module      模型
  * @param $contentid   文章ID
  * @param $siteid      站点ID
  */
 function get_info($module, $contentid, $siteid)
 {
     $category = getcache('category_content_' . $siteid, 'commons');
     list($module, $catid) = explode('_', $module);
     $cat = $category[$catid];
     if ($cat['type'] == 1) {
         //单网页   3.28  增加评论模块对单网页的支持
         return array('title' => $cat['catname'], 'url' => $cat['url'], 'allow_comment' => 1);
     } else {
         //不是单网页
         if (empty($contentid) || empty($catid)) {
             return false;
         }
         $this->db->set_catid($catid);
         $r = $this->db->get_one(array('catid' => $catid, 'id' => $contentid), '`title`');
         //$category = getcache('category_content_'.$siteid, 'commons');
         $model = getcache('model', 'commons');
         //$cat = $category[$catid];
         $data_info = array();
         if ($cat['type'] == 0) {
             $this->db->table_name = $this->db->db_tablepre . $model[$cat['modelid']]['tablename'] . '_data';
             $data_info = $this->db->get_one(array('id' => $contentid));
         }
         if ($r) {
             return array('title' => $r['title'], 'url' => go($catid, $contentid, 1), 'allow_comment' => isset($data_info['allow_comment']) ? $data_info['allow_comment'] : 1);
         } else {
             return false;
         }
     }
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:36,代码来源:comment_api.class.php


示例18: callback

 /**
  * 返回登录
  */
 public function callback()
 {
     require_once COMMON_LIB_PATH . "QqConnect/API/qqConnectAPI.php";
     $qc = new QC();
     $callback = $qc->qq_callback();
     $openid = $qc->get_openid();
     $user = K("user")->field("uid,username,password,qqau,userlock,uuid,usergroup")->where(array("qqau" => $openid))->find();
     session("qqau", $openid);
     if (empty($user["qqau"])) {
         //首次登录或没有绑定账号
         $qc = new QC($callback, $openid);
         $arr = $qc->get_user_info();
         session("UserInfo", $arr["nickname"]);
         go("Passport/Qqlogin/index");
     } elseif ($user["qqau"] == $openid) {
         //数据库比对正确
         if ($user["userlock"] == 1) {
             $this->error("您已经被锁定,请联系管理员!");
         }
         //$this->eve_exp($user["uid"]);
         $loginData = array("logintime" => time(), "loginip" => ip::getClientIp(), "qqau" => $openid);
         M("user")->where(array("uid" => $user["uid"]))->save($loginData);
         // p($_POST);
         session("username", $user["username"]);
         session("uid", $user["uid"]);
         session("uuid", $user["uuid"]);
         session("usergroup", $user["usergroup"]);
         $this->success("登录成功!正在跳转...", U(__WEB__));
     }
 }
开发者ID:a707937337,项目名称:proxy,代码行数:33,代码来源:QqloginControl.class.php


示例19: __init

 public function __init()
 {
     if (is_file(MODULE_PATH . 'Lock.php') && ACTION != 'isLock') {
         go('isLock');
     }
     $this->step = Q('step', 1, 'intval');
 }
开发者ID:suhanyujie,项目名称:spider,代码行数:7,代码来源:IndexController.class.php


示例20: sort

 public function sort()
 {
     $db = M('cate');
     foreach ($_POST as $id => $sort) {
         $db->where(array('id' => $id))->setField('sort', $sort);
     }
     go(U('Category/index'));
 }
开发者ID:xupp,项目名称:ThinkPHP,代码行数:8,代码来源:CategoryController.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP goU函数代码示例发布时间:2022-05-15
下一篇:
PHP gmtime函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap