本文整理汇总了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);
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
if (!$_SESSION['user']) {
header('location:' . U('admin/Index/login'));
}
}
示例3: PdoHelper
function __construct()
{
$this->pdo = new PdoHelper();
parent::__construct();
$this->loadWebConfig();
$this->getLoginuUser();
}
示例4: __construct
/**
* CourseController constructor.
*/
public function __construct()
{
// 调用父类控制器
parent::__construct();
// 初始化curl管理器
$this->_curl_init();
}
示例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');
}
示例6: __construct
public function __construct()
{
$this->jsonUtils = new \Org\Util\JsonUtils();
$this->session_handle = new \Org\Util\SessionHandle();
$this->dao = M('service');
parent::__construct();
}
示例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());
}
}
示例8:
function __construct()
{
parent::__construct();
if (empty($_COOKIE['USERNAME'])) {
//$this->success('', '?c=user&a=login');
}
}
示例9: D
function __construct()
{
parent::__construct();
$this->room = D("Room");
$this->room_type = D("Room_type");
$this->lunbo = D("Lunbo");
}
示例10: __construct
public function __construct()
{
parent::__construct();
if (ACTION_NAME != "login" && ACTION_NAME != "code" && ACTION_NAME != "check_verify") {
$this->check();
}
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->mkCateData();
$this->getNav();
$this->getCategoryTree();
}
示例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'];
}
示例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();
//加入底部
}
示例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');
}
示例15: __construct
public function __construct()
{
parent::__construct();
if (!session('id')) {
$this->error('必须先登录', U('Login/index'));
}
}