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


PHP Controller::__construct方法代碼示例

本文整理匯總了PHP中think\Controller::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller::__construct方法的具體用法?PHP Controller::__construct怎麽用?PHP Controller::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在think\Controller的用法示例。


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     if (!session('?username')) {
         $this->error('請先登錄', U('login/login'), 3);
     }
 }
開發者ID:PieHust,項目名稱:embahust,代碼行數:7,代碼來源:CommonController.class.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     if (!$_SESSION['user']) {
         header('location:' . U('admin/Index/login'));
     }
 }
開發者ID:cassileShu,項目名稱:ebxzj,代碼行數:7,代碼來源:BaseController.class.php

示例3: PdoHelper

 function __construct()
 {
     $this->pdo = new PdoHelper();
     parent::__construct();
     $this->loadWebConfig();
     $this->getLoginuUser();
 }
開發者ID:klsf,項目名稱:kldns,代碼行數:7,代碼來源:Klsf.php

示例4: __construct

 /**
  * CourseController constructor.
  */
 public function __construct()
 {
     // 調用父類控製器
     parent::__construct();
     // 初始化curl管理器
     $this->_curl_init();
 }
開發者ID:noFloat,項目名稱:cyxbsMobile,代碼行數:10,代碼來源:CourseController.class.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:

 function __construct()
 {
     parent::__construct();
     if (empty($_COOKIE['USERNAME'])) {
         //$this->success('', '?c=user&a=login');
     }
 }
開發者ID:vipfox,項目名稱:bms,代碼行數:7,代碼來源:BaseController.class.php

示例9: D

 function __construct()
 {
     parent::__construct();
     $this->room = D("Room");
     $this->room_type = D("Room_type");
     $this->lunbo = D("Lunbo");
 }
開發者ID:283541486,項目名稱:kaixinwa2.0,代碼行數:7,代碼來源:IndexController.class.php

示例10: __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

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $this->mkCateData();
     $this->getNav();
     $this->getCategoryTree();
 }
開發者ID:hiden2,項目名稱:thinkshop,代碼行數:7,代碼來源:CommonController.class.php

示例12: __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

示例13: __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

示例14: 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

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     if (!session('id')) {
         $this->error('必須先登錄', U('Login/index'));
     }
 }
開發者ID:highestgoodlikewater,項目名稱:admin.28.com,代碼行數:7,代碼來源:IndexController.class.php


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