本文整理匯總了PHP中front::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP front::__construct方法的具體用法?PHP front::__construct怎麽用?PHP front::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類front
的用法示例。
在下文中一共展示了front::__construct方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$this->load->model('model_base');
$this->load->model('model_comment');
$this->load->helper('download_helper');
}
示例2: __construct
public function __construct()
{
parent::__construct();
/***********uid*******************/
$uid = isset($_GET['uid']) && intval($_GET['uid']) > 0 ? intval($_GET['uid']) : 0;
//設置uid為request的數值
$uid = $uid > 0 ? $uid : $this->uid;
$this->assign('uid', $uid);
if (!$uid) {
header('Location:/');
exit;
}
$thisUser = $this->user;
$this->assign('user', $thisUser);
/**********************************************************/
if ($this->uid == $uid) {
$sub = '我';
$my = 1;
} else {
$sub = '他(她)';
$my = 0;
}
$this->uid = $uid;
$this->assign('sub', $sub);
$this->assign('my', $my);
/*********************判斷是不是各種經銷商***************************/
$storeUserIndependent = 0;
//經銷商用戶是否單獨建表存儲
if (intval(loadConfig('store', 'storeUserIndependent'))) {
$storeUserIndependent = 1;
//經銷商用戶是否單獨建表存儲
}
if ($uid == $this->uid) {
$this->assign('canManage', 1);
}
if ($uid == $this->uid && !$storeUserIndependent) {
$store_db = bpBase::loadModel('store_model');
$is4sStore = 0;
if ($store_db->select(array('storetype' => 1, 'uid' => $this->uid))) {
$is4sStore = 1;
}
$this->assign('is4sStore', $is4sStore);
//carRental
$isRentalStore = 0;
if ($store_db->select(array('storetype' => 3, 'uid' => $this->uid))) {
$isRentalStore = 1;
}
$this->assign('isRentalStore', $isRentalStore);
//ucar
$ucar_store_db = bpBase::loadModel('usedcar_store_model');
$thisUcarStore = $ucar_store_db->select(array('uid' => $this->uid));
$this->assign('isUcarStore', $thisUcarStore ? 1 : 0);
}
}
示例3:
function __construct()
{
parent::__construct();
}
示例4: M
function __construct()
{
parent::__construct();
$this->site_db = M('site');
$this->channel_db = M('channel');
$this->article_db = M('article');
//wechat_id
$this->wechat_id = $_GET['wecha_id'];
//
if (isset($_GET['token'])) {
$this->token = $_GET['token'];
$this->site = $this->site_db->getSiteByToken($this->token);
$this->siteid = $this->site['id'];
}
if (isset($_GET['channelid'])) {
$this->channel = $this->channel_db->get_one(array('id' => intval($_GET['channelid'])));
$this->token = $this->channel['token'];
if ($this->token) {
$this->site = $this->site_db->getSiteByToken($this->token);
$this->siteid = $this->site['id'];
}
$this->assign('channel', $this->channel);
}
if (isset($_GET['contentid'])) {
$this->article = $this->article_db->getContentByID($_GET['contentid']);
$thisContent = array();
$thisContent['title'] = $this->article->title;
$thisContent['content'] = convertToMobile($this->article->content);
$this->assign('content', $thisContent);
//
$this->channel = $this->channel_db->get_one(array('id' => $this->article->channel_id));
$this->token = $this->channel['token'];
if ($this->token) {
$this->site = $this->site_db->getSiteByToken($this->token);
$this->siteid = $this->site['id'];
}
$this->assign('channel', $this->channel);
}
if (!$this->site) {
exit('no site');
}
//
$this->navChannels = $this->channel_db->navChannels($this->siteid);
$this->ys = intval($this->siteid % 10);
if (!isset($_SESSION['previewSkin'])) {
$this->smartyDir = $this->ys . '/' . $this->token . '/';
$cssDir = 'smarty/templates/' . $this->ys . '/' . $this->token;
} else {
//預覽狀態
$this->smartyDir = 'tpls/' . $_SESSION['previewSkin'] . '/';
$cssDir = 'smarty/templates/tpls/' . $_SESSION['previewSkin'];
$this->site['template'] = $_SESSION['previewSkin'];
}
$this->assign('cssdir', $cssDir);
$this->assign('ys', $this->ys);
//頭部和底部
$this->assign('header', $this->smartyDir . 'header.html');
$this->assign('footer', $this->smartyDir . 'footer.html');
//
$this->site['plugmenucolor'] = '#f60';
$this->assign('site', $this->site);
$this->navChannels = $this->convertLinks($this->navChannels);
$this->assign('navChannels', $this->navChannels);
$this->assign('homeUrl', 'index.php?token=' . $this->token);
$this->assign('homeurl', 'index.php?token=' . $this->token);
$this->assign('token', $this->token);
//rand
$randNum = rand(1, 9999);
$this->assign('rand', $randNum);
//company
$this->company = M('company')->getCompany($this->token);
$this->assign('company', $this->company);
//plug menu
$showPlugMenu = 0;
$plugMenus = $this->_getPlugMenu();
if (count($plugMenus)) {
$showPlugMenu = 1;
}
$this->assign('showPlugMenu', $showPlugMenu);
$this->assign('plugmenus', $plugMenus);
}
示例5: __construct
public function __construct()
{
parent::__construct();
$this->load->model('model_user');
}
示例6:
function __construct()
{
parent::__construct();
$this->special_cat_db = bpBase::loadModel('special_cat_model');
$this->special_db = bpBase::loadModel('special_model');
}