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


PHP base_controller類代碼示例

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


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

示例1: varasto_edit_post

 public static function varasto_edit_post($tuote_id)
 {
     $uudet_tiedot = $_POST;
     /*
      * Asetetaan päivämäärä ja timestamp. 
      * Olisi järkevää, jos tämä tulisi aina automaattisesti.
      */
     /* 
      * Mikäli lukumäärää ei ole annettu, asetetaan arvoksi 
      * nolla FFFF:n sijasta.
      */
     if (empty($uudet_tiedot['lukumaara'])) {
         $uudet_tiedot['lukumaara'] = 0;
     }
     //Luodaan uusi tuote, jolla kutsutaan modifya...
     $muuttujat = array('tuote_id' => $uudet_tiedot['tuote_id'], 'tuotteen_nimi' => $uudet_tiedot['tuotteen_nimi'], 'kuvaus' => $uudet_tiedot['kuvaus'], 'valmistaja' => $uudet_tiedot['valmistaja'], 'lukumaara' => $uudet_tiedot['lukumaara'], 'history_date' => $uudet_tiedot['history_date']);
     // Käyttäjän nimi saadaan automaattisesti
     $uudet_tiedot['kayttajatunnus'] = base_controller::get_user_logged_in();
     $muuttujat = array('tuote_id' => $uudet_tiedot['tuote_id'], 'kayttajatunnus' => $kayttajatunnus, 'lukumaara' => $uudet_tiedot['lukumaara']);
     $varastotilanne = new Varasto($muuttujat);
     //$errors = $Varasto->errors();
     $varastotilanne->modify();
     // Listataan varastotiedot, jotta muutos näkyy
     $varastotilanne = Varasto::all();
     View::make('Varasto/Varastonlistaus.html', array('varastotilanne' => $varastotilanne));
 }
開發者ID:nkostiai,項目名稱:Varasto,代碼行數:26,代碼來源:VarastoController.php

示例2:

 function _post_controller_constructor()
 {
     parent::_post_controller_constructor();
     if (!isset($this->admin_panel)) {
         $this->load->library('xmenu', null, 'admin_panel');
     }
 }
開發者ID:rip-projects,項目名稱:judge,代碼行數:7,代碼來源:app_base_controller.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $user = M('User')->getUserById($this->user_session['uid']);
     $user['last_ip'] = long2ip($user['last_ip']);
     $this->assign('user', $user);
 }
開發者ID:fkssei,項目名稱:pigcms10,代碼行數:7,代碼來源:account_controller.php

示例4: _render

 public function _render($e = NULL)
 {
     if ($e instanceof HTTPException) {
         $this->view->assign('exception', $e);
         $errstr = get_class($e);
         $templatefile = $errstr . ".tpl";
         $errstr = preg_replace('/^HTTP/', '', $errstr);
         $errstr = trim(preg_replace('/([A-Z])/', ' $1', $errstr));
         $afn = array(array($this->view->template_dir . '/errorpage', $templatefile), array($this->view->template_dir . '/errorpage', 'default.tpl'), array("./vanilla/extensions/errorpage/views", $templatefile), array("./vanilla/extensions/errorpage/views", 'default.tpl'));
         foreach ($afn as $a) {
             list($tdir, $tf) = $a;
             if (file_exists("{$tdir}/{$tf}")) {
                 $this->view->template_dir = $tdir;
                 $this->viewname = $tf;
                 break;
             }
         }
     } else {
         $errstr = '';
         $this->view->template_dir = "./vanilla/extensions/errorpage/views";
         $this->viewname = "exception.tpl";
     }
     $this->view->assign('errorstr', $errstr);
     return parent::_render();
 }
開發者ID:robertosciarra,項目名稱:vanilla-mvc,代碼行數:25,代碼來源:errorpage.php

示例5: foreach

 function __construct(&$app)
 {
     parent::__construct($app);
     if (@constant('WITHOUT_STRIP_HTML')) {
         $this->enable_strip_whitespace = false;
     }
     $this->app = $app;
     $this->_request = kernel::single('base_component_request');
     $this->_response = kernel::single('base_component_response');
     foreach (kernel::serviceList('site_controller_construct') as $service) {
         $service->prepare($this);
     }
     //構造時加載
     //finish modify controler-action html
     foreach (kernel::serviceList(sprintf('site_controller_content.%s.%s.%s', $this->_request->get_app_name(), $this->_request->get_ctl_name(), $this->_request->get_act_name())) as $class_name => $service) {
         if ($service instanceof site_interface_controller_content) {
             if (method_exists($service, 'modify')) {
                 $this->__finish_modifier[$class_name] = $service;
             }
             if (method_exists($service, 'boot')) {
                 $service->boot($this);
             }
         }
     }
 }
開發者ID:dalinhuang,項目名稱:shopexts,代碼行數:25,代碼來源:controller.php

示例6: unset

 function __destruct()
 {
     parent::__destruct();
     unset($this->contactModel);
     unset($this->userModel);
     unset($this->tagModel);
 }
開發者ID:NASH-WORK,項目名稱:NASH-CRM,代碼行數:7,代碼來源:contact_controller.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     if (!$this->user) {
         die("Members only. <a href='/users/login'>Please login</a>");
     }
 }
開發者ID:rebekahheacock,項目名稱:dwa15-archive,代碼行數:7,代碼來源:c_posts.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     if (empty($this->store_session)) {
         json_return(999, '會話超時,請刷新頁麵重試');
     }
 }
開發者ID:fkssei,項目名稱:pigcms10,代碼行數:7,代碼來源:attachment_controller.php

示例9: __construct

 public function __construct($_vars)
 {
     parent::__construct();
     var_dump($_vars);
     var_dump($this->get_app_path());
     var_dump($this->get_base_url());
 }
開發者ID:maxik001,項目名稱:fwork,代碼行數:7,代碼來源:page_not_exists.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     if (empty($this->store_session)) {
         redirect(url('index:index'));
     }
 }
開發者ID:fkssei,項目名稱:pigcms10,代碼行數:7,代碼來源:goods_controller.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     #Specific css is added to an array which already has one element from the parent constructor method.
     #$this->$client_files[] = "/css/users.css"; # doesn't work so I use the following array_push invocation instead
     #array_push($this->client_files, "/css/users.css"); # this works
     #$this->template->client_files = Utils::load_client_files($this->client_files);
 }
開發者ID:rtizard,項目名稱:dwa,代碼行數:8,代碼來源:c_data.php

示例12:

 function _post_controller_constructor()
 {
     parent::_post_controller_constructor();
     // FIXME this should be plugin
     // if (!isset($this->admin_panel)) {
     //     $this->load->library('xmenu', null, 'admin_panel');
     // }
 }
開發者ID:rip-projects,項目名稱:ark-php,代碼行數:8,代碼來源:app_base.php

示例13: __construct

 public function __construct()
 {
     parent::__construct();
     # Make sure user is logged in if they want to use anything in this controller
     if (!$this->user) {
         die("Members only. <a href='/users/login'>Login</a>");
     }
 }
開發者ID:nvarney,項目名稱:dwa,代碼行數:8,代碼來源:c_posts.php

示例14: __construct

 /**
  * 構造函數
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->userModel = F::load_model('user');
     $this->tagModel = F::load_model('tag');
     $this->photoTool = F::loadClass('photo');
     $this->contactModel = F::load_model('contact', array());
 }
開發者ID:NASH-WORK,項目名稱:NASH-CRM,代碼行數:14,代碼來源:user_controller.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model('system_model');
     $this->_compID = $this->session->userdata('compID');
     date_default_timezone_set("Asia/Manila");
     $this->_datetime = date('Y-m-d H:i:s');
 }
開發者ID:kirkmicz,項目名稱:iSMS,代碼行數:8,代碼來源:company_controller.php


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