本文整理汇总了PHP中Main::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::__construct方法的具体用法?PHP Main::__construct怎么用?PHP Main::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
function __construct()
{
parent::__construct();
if (config_item('disable_api')) {
die("The API has been disabled\n");
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
/*BEGIN ADMIN FUNCTIONS CODE*/
//ADMIN LOGOUT
if (isset($_POST['submit_login'])) {
$this->AdminLogin();
}
//CHECK ADMIN LOGIN
if (@basename($_SERVER['PHP_SELF']) != "login.php") {
$this->CheckAdminLogin();
}
//ADMIN LOGOUT
if (isset($_GET['action']) && $_GET['action'] == "logout") {
$this->AdminLogOut();
}
//ADMIN FORGOT PASSWORD
if (isset($_POST['submit_forgetpassword'])) {
$this->AdminForgotPassword();
}
//ADMIN PROFILE UPDATE
if ($this->pagefilename == "admin.php") {
$info_array = array("where" => "user_type='1' and user_id='1'");
$this->data = $this->GetSingleRecord("user_master", $info_array);
}
if (isset($_POST['submit_profile'])) {
$this->AdminProfile();
}
/*END ADMIN FUNCTIONS CODE*/
/*BEGIN SITE SETTING FUNCTION ASSIGN */
if (isset($_POST['submit_settings'])) {
$this->UpdateSiteSettings();
}
/*CODE SITE SETTING FUNCTION ASSIGN */
}
示例3: __construct
public function __construct()
{
parent::__construct();
// Your own constructor code
//config page rend
$this->_setMainPage($this->main_page);
}
示例4: __construct
public function __construct()
{
parent::__construct();
if (!$this->login_model->role("user")) {
redirect(base_url("login"));
} else {
}
}
示例5: __construct
public function __construct()
{
parent::__construct();
// Your own constructor code
//config page rend
$this->load->model('md_ourteam');
$this->_setMainPage($this->main_page);
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->setTable('EDB_SEMESTRES');
$this->setTableLang('EDB_SEMESTRES_LANG');
$this->setPk('SEM_NUM');
$this->setOrder('SEM_ORDRE');
}
示例7: __construct
/**
* Cruise constructor.
*
* Sets the service name, response type and prepares
* the api parameters.
*
* @param string $token
*/
public function __construct($token)
{
parent::__construct();
$this->token = $token;
$this->responseType = $this->config->get("app.Cruise.response_type");
$this->apiUrl = $this->config->get("app.Cruise.url");
$this->apiParams = ['api_token' => $token, 'api_type' => $this->config->get("app.Cruise.response_type")];
}
示例8: __construct
public function __construct()
{
parent::__construct();
// Your own constructor code
//config page rend
$this->load->model('md_message');
$this->load->library('session');
$this->_setMainPage($this->main_page);
}
示例9: __construct
public function __construct()
{
parent::__construct();
// Your own constructor code
//config page rend
//$this->_setMainPage($this->main_page);
$this->load->library('session');
$this->load->library('image_lib');
$this->load->helper('url');
}
示例10: die
function __construct()
{
parent::__construct();
if (config_item('disable_api')) {
die("The API has been disabled\n");
}
if (config_item('apikey') != $this->input->get('apikey')) {
die("Invalid API key\n");
}
}
示例11: __construct
public function __construct()
{
parent::__construct();
if (!$this->login_model->role("admin")) {
$this->session->set_userdata(array("returnto" => current_url()));
redirect(base_url("login"));
} else {
//get all components for admin sidebar
$this->data['components'] = array(array("id" => "cp", "title" => "لوحة التحكم", "children" => array(array("title" => "لوحة التحكم", "link" => $this->data['cp']), array("title" => "رئيسية الموقع", "link" => base_url()), array("title" => "الاعدادات العامة", "link" => base_url("admin/settings")), array("title" => "تسجيل خروج", "link" => base_url("login/logout")))));
//get current page
$this->data['cur_page'] = "cp";
}
}
示例12: __construct
public function __construct()
{
parent::__construct();
$this->load->model("User");
$this->load->model("Post");
$this->load->model("Comment");
if (!$this->is_login() || $this->User->exists($this->current_user["user_id"]) == false) {
if ($this->is_login()) {
$this->session->set_flashdata("error_message", "Sorry, your account was removed! ");
} else {
$this->session->set_flashdata("error_message", "Please Login");
}
$this->session->sess_destroy();
redirect(base_url('/'));
}
$this->load->view('partials/header', array('current_user' => $this->current_user));
// $this->output->enable_profiler();
}
示例13: array
/**
* Конструктор создает объект со свойствами соответствующими таблице
* юзеров и если юзер существует и имеет телефонные номера, то
* сохраняет их в массив $this->phones
*/
function __construct($params = null)
{
parent::__construct($params);
if ($this->is_exists()) {
$phones = array();
$query = ' SELECT *
FROM phones_tbl
WHERE user_id=' . $this->id . ';';
$result = DB::query($query);
if ($result->num_rows === 0) {
return;
}
$phones = DB::fetch();
foreach ($phones as &$phone) {
$phone = new Phone($phone);
}
$this->phones = $phones;
}
}
示例14: __construct
public function __construct($super)
{
parent::__construct($super);
$this->controller = $super->core->getConfig()['site_config']['homecontroller'];
$this->method = $super->core->getConfig()['site_config']['homemethod'];
$url = $this->parseUrl();
if (file_exists('app/controllers/' . $url[0] . '.php')) {
$this->controller = $url[0];
unset($url[0]);
}
require_once '/app/controllers/' . $this->controller . '.php';
$this->controller = new $this->controller($this->super);
if ($this->controller->hasRestriction()) {
$rows = $this->super->getAcl()->hasRoleArr($this->controller->restrictionRole);
if (count($rows) == 0 || !$this->super->getAcl()->isLoggedin()) {
// Geen toegang.
Helpers::redirect('/harmstercms/');
}
}
// try and set the layout
if (isset($this->controller->layout)) {
$this->layout = $this->controller->layout;
}
if (isset($url[1])) {
if (method_exists($this->controller, $url[1])) {
$this->method = $url[1];
unset($url[1]);
}
}
if (isset($this->controller->restrictMethods) && is_array($this->controller->restrictMethods)) {
if (array_key_exists($this->method, $this->controller->restrictMethods)) {
$restriction = $this->controller->restrictMethods[$this->method];
if (!$this->super->getAcl()->hasRole($restriction)) {
var_dump($this->super->getAcl()->hasRole($restriction));
echo 'Hij komt hier';
//Helpers::redirect('/harmstercms/');
}
}
}
$this->params = $url ? array_values($url) : [];
$result = call_user_func_array([$this->controller, $this->method], $this->params);
$this->result = $result;
}
示例15: __construct
public function __construct(\Magento\Framework\Code\NameBuilder $nameBuilder, Context $context)
{
$this->nameBuilder = $nameBuilder;
parent::__construct($context);
}