当前位置: 首页>>代码示例>>PHP>>正文


PHP Main::__construct方法代码示例

本文整理汇总了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");
     }
 }
开发者ID:LanceSandino,项目名称:Stikked,代码行数:7,代码来源:Api.php

示例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 */
 }
开发者ID:bharat383,项目名称:phpminiframework,代码行数:35,代码来源:Admin.class.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     // Your own constructor code
     //config page rend
     $this->_setMainPage($this->main_page);
 }
开发者ID:27insep,项目名称:simple-company-website,代码行数:7,代码来源:workwithus.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     if (!$this->login_model->role("user")) {
         redirect(base_url("login"));
     } else {
     }
 }
开发者ID:engahmeds3ed,项目名称:movesapp,代码行数:8,代码来源:user.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     // Your own constructor code
     //config page rend
     $this->load->model('md_ourteam');
     $this->_setMainPage($this->main_page);
 }
开发者ID:27insep,项目名称:simple-company-website,代码行数:8,代码来源:ourteam.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setTable('EDB_SEMESTRES');
     $this->setTableLang('EDB_SEMESTRES_LANG');
     $this->setPk('SEM_NUM');
     $this->setOrder('SEM_ORDRE');
 }
开发者ID:ENSICAEN-Digital-Booklet,项目名称:EDB-Plugin,代码行数:8,代码来源:Semestre.php

示例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")];
 }
开发者ID:smsorange,项目名称:api-library,代码行数:16,代码来源:Cruise.php

示例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);
 }
开发者ID:27insep,项目名称:simple-company-website,代码行数:9,代码来源:contactus.php

示例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');
 }
开发者ID:27insep,项目名称:simple-company-website,代码行数:10,代码来源:core.php

示例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");
     }
 }
开发者ID:GitcloudNL,项目名称:Stikked,代码行数:10,代码来源:api.php

示例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";
     }
 }
开发者ID:engahmeds3ed,项目名称:movesapp,代码行数:13,代码来源:admin.php

示例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();
 }
开发者ID:johndavid9991,项目名称:codingdojophp,代码行数:18,代码来源:dashboard.php

示例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;
        }
    }
开发者ID:nomid,项目名称:forforce,代码行数:24,代码来源:user.php

示例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;
 }
开发者ID:Hawiak,项目名称:harmstercms,代码行数:43,代码来源:App.php

示例15: __construct

 public function __construct(\Magento\Framework\Code\NameBuilder $nameBuilder, Context $context)
 {
     $this->nameBuilder = $nameBuilder;
     parent::__construct($context);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:5,代码来源:Wizard.php


注:本文中的Main::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。