本文整理汇总了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();
}
示例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;
}
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
if (!$_SESSION['user']) {
header('location:' . U('admin/Index/login'));
}
}
示例4: PdoHelper
function __construct()
{
$this->pdo = new PdoHelper();
parent::__construct();
$this->loadWebConfig();
$this->getLoginuUser();
}
示例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: __construct
public function __construct()
{
parent::__construct();
$this->mkCateData();
$this->getNav();
$this->getCategoryTree();
}
示例9:
function __construct()
{
parent::__construct();
if (empty($_COOKIE['USERNAME'])) {
//$this->success('', '?c=user&a=login');
}
}
示例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'];
}
示例11: __construct
public function __construct()
{
parent::__construct();
if (ACTION_NAME != "login" && ACTION_NAME != "code" && ACTION_NAME != "check_verify") {
$this->check();
}
}
示例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();
//加入底部
}
示例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');
}
示例14: __construct
public function __construct()
{
parent::__construct();
if (!session('?username')) {
$this->error('请先登录', U('login/login'), 3);
}
}
示例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');
}