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


PHP think\Controller类代码示例

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


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

示例1: __construct

 /**
  * CourseController constructor.
  */
 public function __construct()
 {
     // 调用父类控制器
     parent::__construct();
     // 初始化curl管理器
     $this->_curl_init();
 }
开发者ID:noFloat,项目名称:cyxbsMobile,代码行数:10,代码来源:CourseController.class.php

示例2: session

 function __construct()
 {
     parent::__construct();
     //检查 session 是否已经登录
     $users = session('admin_info');
     if ($users) {
         if (md5($users['admin_id'] . C('secret_key')) != $users['secret_key']) {
             session_destroy();
             redirect(U('Public/login'));
             exit;
         }
         $this->admin_id = $users['admin_id'];
         $this->admin_name = $users['admin_name'];
     } else {
         redirect(U('Public/login'));
         exit;
     }
     $this->assign('loginUser', $users);
     /***----------权限控制-----------***/
     $AuthLogic = new \Admin\Logic\AuthLogic($this->admin_id);
     if (true === $AuthLogic->check_auth()) {
     } else {
         if (IS_AJAX) {
             $this->error('没有操作权限');
             exit;
         } else {
             showmessage('没有该页面权限');
             exit;
         }
     }
 }
开发者ID:sea009,项目名称:wkAdmin,代码行数:31,代码来源:CommonController.class.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     if (!$_SESSION['user']) {
         header('location:' . U('admin/Index/login'));
     }
 }
开发者ID:cassileShu,项目名称:ebxzj,代码行数:7,代码来源:BaseController.class.php

示例4: PdoHelper

 function __construct()
 {
     $this->pdo = new PdoHelper();
     parent::__construct();
     $this->loadWebConfig();
     $this->getLoginuUser();
 }
开发者ID:klsf,项目名称:kldns,代码行数:7,代码来源:Klsf.php

示例5: D

 function __construct()
 {
     parent::__construct();
     //if(empty($_SESSION['USER_ID']))exit(C('SITE_LANG.LOGIN_ALERT'));//check login
     $this->visible_tag_model = D('VisibleTag');
     $this->follow_model = D('Follow');
 }
开发者ID:Hishengs,项目名称:Heysoo,代码行数:7,代码来源:TagController.class.php

示例6: __construct

 public function __construct()
 {
     $this->jsonUtils = new \Org\Util\JsonUtils();
     $this->session_handle = new \Org\Util\SessionHandle();
     $this->dao = M('service');
     parent::__construct();
 }
开发者ID:sayi21cn,项目名称:CarService-ServerSide,代码行数:7,代码来源:MerServiceController.class.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     //读取配置信息
     $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->assign('web_stting', $web_stting);
     //站点状态判断
     if ($web_stting['site_status'] != 1) {
         echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
         echo $web_stting['closed_reason'];
         exit;
     } else {
         $this->check_login();
         $link = M('Link')->where(array('status' => 1))->order('sort DESC')->select();
         $this->assign('link', $link);
         $this->assign('seo', seo());
     }
 }
开发者ID:noikiy,项目名称:baomihua,代码行数:27,代码来源:BaseController.class.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->mkCateData();
     $this->getNav();
     $this->getCategoryTree();
 }
开发者ID:hiden2,项目名称:thinkshop,代码行数:7,代码来源:CommonController.class.php

示例9:

 function __construct()
 {
     parent::__construct();
     if (empty($_COOKIE['USERNAME'])) {
         //$this->success('', '?c=user&a=login');
     }
 }
开发者ID:vipfox,项目名称:bms,代码行数:7,代码来源:BaseController.class.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     if (!empty($this->controll_keywords)) {
         $this->model = D($this->controll_keywords);
     }
     $this->system_name = "兔芭露<span style='vertical-align:super; font-size:9px'>TM</span>产销存管理系统";
     $this->page_title = "RMS";
     $this->brand = C('brand');
     $this->brand_lang = C('brand_lang');
     $this->retailer_products_status = C('retailer_products_status');
     $this->plans_status = C('plans_status');
     $this->retailers = D('Retailer')->getRetailers();
     $this->retailer_id_selected = (int) I('get.retailer_id');
     $this->retailer_payment_status = C('retailer_payment_status');
     $this->retailer_payment_status_selected = (int) I('get.retailer_payment_status');
     $this->retailer_apply_status = C('retailer_apply_status');
     $this->retailer_apply_status_selected = (int) I('get.retailer_apply_status');
     $this->bill_status = C('retailer_bill_status');
     $this->bill_status_selected = (int) I('get.bill_status');
     $this->initSubMenus();
     $this->CONTROLLER_NAME = CONTROLLER_NAME;
     $this->ACTION_NAME = ACTION_NAME;
     $notices = D('articles')->getArticles(array(), 5);
     $this->notices = $notices['data'];
 }
开发者ID:andychang88,项目名称:fuzhuang.erp.com,代码行数:26,代码来源:CommonController.class.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     if (ACTION_NAME != "login" && ACTION_NAME != "code" && ACTION_NAME != "check_verify") {
         $this->check();
     }
 }
开发者ID:dongsongsong,项目名称:vuejs-hui,代码行数:7,代码来源:BaseController.class.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     //初始化系统信息
     $m = D('Home/System');
     $GLOBALS['CONFIG'] = $m->loadConfigs();
     $this->assign("baseUser", $_SESSION['USER']);
     $areas = D('Home/Areas');
     $areaList = $areas->getCitys();
     $areaId2 = $this->getDefaultCity();
     $currArea = $areas->getArea($areaId2);
     $this->assign('template_path', $template_path);
     //获取分类
     $gcm = D('Home/GoodsCats');
     $catList = $gcm->getGoodsCats($areaId2);
     $spm = D('Home/Shops');
     $selfShop = $spm->getSelfShop($areaId2);
     $this->assign('selfShop', $selfShop);
     $m = D('Home/Cart');
     $cartInfo = $m->getCartInfo();
     $this->assign('cartcnt', count($cartInfo["cartgoods"]));
     $this->assign('searchType', I("searchType", 1));
     $this->assign('catList', $catList);
     $this->assign('currCity', $areaList[$areaId2]);
     $this->assign('cityList', $areaList);
     $this->assign('areaId2', $areaId2);
     $this->assign('currArea', $currArea);
     $this->assign('CONF', $GLOBALS['CONFIG']);
     $this->header();
     //加入头部
     $this->footer();
     //加入底部
 }
开发者ID:haoljp,项目名称:wstmall,代码行数:33,代码来源:BaseAction.class.php

示例13: D

 function __construct()
 {
     parent::__construct();
     //if(empty($_SESSION['USER_ID']))exit(C('SITE_LANG.LOGIN_ALERT'));//check login
     $this->user_model = D('User');
     $this->user_config_model = D('UserConfig');
 }
开发者ID:Hishengs,项目名称:Heysoo,代码行数:7,代码来源:ActionController.class.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     if (!session('?username')) {
         $this->error('请先登录', U('login/login'), 3);
     }
 }
开发者ID:PieHust,项目名称:embahust,代码行数:7,代码来源:CommonController.class.php

示例15: D

 function __construct()
 {
     parent::__construct();
     //if(empty($_SESSION['USER_ID']))exit(C('SITE_LANG.LOGIN_ALERT'));//check login
     $this->comment_model = D('Comment');
     $this->piece_comment_model = D('PieceComment');
 }
开发者ID:Hishengs,项目名称:Heysoo,代码行数:7,代码来源:CommentController.class.php


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