當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Public_Controller類代碼示例

本文整理匯總了PHP中Public_Controller的典型用法代碼示例。如果您正苦於以下問題:PHP Public_Controller類的具體用法?PHP Public_Controller怎麽用?PHP Public_Controller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Public_Controller類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor method
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     // Call the parent's constructor method
     parent::Public_Controller();
     // Load the required classes
     $this->load->model('users_m');
     $this->load->model('profile_m');
     $this->load->helper('user');
     $this->load->helper('date');
     $this->lang->load('user');
     $this->lang->load('profile');
     $this->load->library('form_validation');
     // Validation rules - git is really pissing me off right now
     $this->validation_rules = array(array('field' => 'display_name', 'label' => lang('profile_display'), 'rules' => 'required|trim|alphanumeric'), array('field' => 'gender', 'label' => lang('profile_gender'), 'rules' => 'trim|max_length[1]'), array('field' => 'dob_day', 'label' => lang('profile_dob_day'), 'rules' => 'trim|numeric|required'), array('field' => 'dob_month', 'label' => lang('profile_dob_month'), 'rules' => 'trim|numeric|required'), array('field' => 'dob_year', 'label' => lang('profile_dob_year'), 'rules' => 'trim|numeric|required'), array('field' => 'bio', 'label' => lang('profile_bio'), 'rules' => 'trim|max_length[1000]'), array('field' => 'phone', 'label' => lang('profile_phone'), 'rules' => 'trim|alpha_numeric|max_length[20]'), array('field' => 'mobile', 'label' => lang('profile_mobile'), 'rules' => 'trim|alpha_numeric|max_length[20]'), array('field' => 'address_line1', 'label' => lang('profile_address_line1'), 'rules' => 'trim'), array('field' => 'address_line2', 'label' => lang('profile_address_line2'), 'rules' => 'trim'), array('field' => 'address_line3', 'label' => lang('profile_address_line3'), 'rules' => 'trim'), array('field' => 'postcode', 'label' => lang('profile_postcode'), 'rules' => 'trim|max_length[20]'), array('field' => 'msn_handle', 'label' => lang('profile_msn_handle'), 'rules' => 'trim|valid_email'), array('field' => 'aim_handle', 'label' => lang('profile_aim_handle'), 'rules' => 'trim|alpha_numeric'), array('field' => 'yim_handle', 'label' => lang('profile_yim_handle'), 'rules' => 'trim|alpha_numeric'), array('field' => 'gtalk_handle', 'label' => lang('profile_gtalk_handle'), 'rules' => 'trim|valid_email'), array('field' => 'gravatar', 'label' => lang('profile_gravatar'), 'rules' => 'trim|valid_email'));
     // Set the validation rules
     $this->form_validation->set_rules($this->validation_rules);
     // If profiles are not enabled, pretend they don't exist
     if (!$this->settings->item('enable_profiles')) {
         show_404();
     }
     // Get the user ID, if it exists
     if ($user = $this->ion_auth->get_user()) {
         $this->user_id = $user->id;
     }
     // The user is not logged in, send them to login page
     if (!$this->ion_auth->logged_in()) {
         redirect('users/login');
     }
 }
開發者ID:Tapha,項目名稱:pyrocms,代碼行數:35,代碼來源:profile.php

示例2: __construct

 function __construct()
 {
     parent::Public_Controller();
     $this->load->library('validation');
     $this->load->model('comments_m');
     $this->lang->load('comments');
 }
開發者ID:netfreak,項目名稱:pyrocms,代碼行數:7,代碼來源:comments.php

示例3: __construct

 /**
  * Constructor method
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::Public_Controller();
     $this->config->load('paypal_constants');
     $this->load->model('orders_m');
     $this->load->model('checkout_m');
 }
開發者ID:rat4m3n,項目名稱:PyroCart,代碼行數:12,代碼來源:checkout.php

示例4: __construct

 function __construct()
 {
     parent::Public_Controller();
     if (!$this->data->user === FALSE) {
         header('Location: ' . $this->config->item('base_url') . 'admin');
     }
 }
開發者ID:google-code-backups,項目名稱:lifepress,代碼行數:7,代碼來源:login.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     //Load lang
     $this->lang->load('galleries/galleries');
     $this->load->model('galleries/galleries_m');
 }
開發者ID:jacksun101,項目名稱:PyroAddons,代碼行數:7,代碼來源:galleries.php

示例6: __construct

 /**
  * Every time this controller is called should:
  */
 public function __construct()
 {
     parent::__construct();
     $this->lang->load("home");
     $this->config->load("tdesign");
     $this->load->helper(array("currency", "tdesign"));
 }
開發者ID:nockout,項目名稱:tshpro,代碼行數:10,代碼來源:home.php

示例7:

 function __construct()
 {
     parent::__construct();
     $this->load->helper(array('form', 'url'));
     $this->load->library('form_validation');
     //$this->load->library('security');
 }
開發者ID:kidino,項目名稱:kidinoci,代碼行數:7,代碼來源:Auth.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->config->load('files/files');
     $this->load->library('files/files');
     $this->_path = FCPATH . rtrim($this->config->item('files:path'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
 }
開發者ID:jacksun101,項目名稱:PyroAddons,代碼行數:7,代碼來源:show.php

示例9:

 function __construct()
 {
     parent::__construct();
     $this->folder = "";
     $this->module = $this->folder;
     $this->page_active = "stats";
     $this->http_ref = base_url() . $this->module;
     $this->load->model("general_model");
     $this->model = new general_model("wa_data");
     $this->model_view = new general_model("v_wa_data");
     $this->model_contact = new general_model("wa_contact");
     $this->model_hukum_adat = new general_model("wa_hukum_adat");
     $this->model_hayati = new general_model("wa_hayati");
     $this->model_hak_atas_tanah = new general_model("wa_hak_atas_tanah");
     $this->model_sejarah = new general_model("wa_sejarah");
     $this->model_lembaga_adat = new general_model("wa_lembaga_adat");
     $this->model_potensi_hayati = new general_model("wa_potensi_hayati");
     //$this->load->model('ion_auth_model')
     $this->load->libraries(array('ion_auth', 'form_validation', 'utils'));
     $this->load->helpers(array('form', 'url', 'lookup', 'language'));
     $this->lang->load('auth');
     $this->user = (array) $this->ion_auth->user()->row();
     $this->tbl_idx = "idx";
     $this->admin_layout = "layout/main_layout";
 }
開發者ID:TrinataBhayanaka,項目名稱:damkar,代碼行數:25,代碼來源:stats.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model('Post');
     $this->load->model('Category');
     $this->load->model('Tag');
 }
開發者ID:csiber,項目名稱:ci-blog,代碼行數:7,代碼來源:Posts.php

示例11: redirect

 function __construct()
 {
     if (login_data('nursery') == "") {
         redirect('home');
     }
     parent::__construct();
 }
開發者ID:unisexx,項目名稱:thaigcd2015,代碼行數:7,代碼來源:nurseries.php

示例12: __construct

 /**
  * The constructor
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->data = new stdClass();
     $this->lang->load('testimonials');
     $this->load->driver('Streams');
 }
開發者ID:jacksun101,項目名稱:PyroAddons,代碼行數:12,代碼來源:testimonials.php

示例13:

 function __construct()
 {
     parent::__construct();
     $this->load->model(array('m_profiles', 'm_posts', 'm_projects', 'm_blogs', 'm_reviews', 'm_videos', 'm_accounts', 'm_comments', 'm_threads', 'm_banners', 'm_stats'));
     $this->load->helper(array('pretty_date'));
     $this->load->vars(array('active' => 'home'));
 }
開發者ID:ndokceplok,項目名稱:Huntdrop,代碼行數:7,代碼來源:main.php

示例14: redirect

 function __construct()
 {
     parent::__construct();
     $this->load->library("go_cart");
     $this->load->helper('currency');
     $this->lang->load(array("cart"));
     $this->load->model(array("location_model"));
     /*make sure the cart isnt empty*/
     if ($this->go_cart->total_items() == 0) {
         redirect('home');
     }
     /*is the user required to be logged in?*/
     if (config_item('require_login')) {
         $this->Customer_model->is_logged_in('checkout');
     }
     if (!config_item('allow_os_purchase') && config_item('inventory_enabled')) {
         /*double check the inventory of each item before proceeding to checkout*/
         $inventory_check = $this->go_cart->check_inventory();
         if ($inventory_check) {
             /*
             OOPS we have an error. someone else has gotten the scoop on our customer and bought products out from under them!
             we need to redirect them to the view cart page and let them know that the inventory is no longer there.
             */
             $this->session->set_flashdata('error', $inventory_check);
             redirect('cart/view_cart');
         }
     }
     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     header("Cache-Control: no-store, no-cache, must-revalidate");
     header("Cache-Control: post-check=0, pre-check=0", false);
     header("Pragma: no-cache");
     $this->load->library('form_validation');
 }
開發者ID:nockout,項目名稱:tshpro,代碼行數:34,代碼來源:checkout.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->library('facebook');
     $this->load->library('gr_auth', IMS_DB_PREFIX . 'customer');
     $this->load->model(['user_home_model', 'event_public/event_public_model', 'rating/rating_model']);
 }
開發者ID:soarmorrow,項目名稱:booking-demo,代碼行數:7,代碼來源:user_dashboard.php


注:本文中的Public_Controller類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。