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


PHP Controller_Base::before方法代碼示例

本文整理匯總了PHP中Controller_Base::before方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller_Base::before方法的具體用法?PHP Controller_Base::before怎麽用?PHP Controller_Base::before使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Controller_Base的用法示例。


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

示例1: before

 public function before()
 {
     parent::before();
     $this->template->js = Asset::js(array('mylibs/jquery.jgrowl.js', 'plugins.js', 'mylibs/jquery.chosen.js', 'mylibs/jquery.ui.touch-punch.js'));
     // $this->current_user = self::current_user();
     // View::set_global('profile_fields', unserialize($user->profile_fields));
 }
開發者ID:roine,項目名稱:wawaw,代碼行數:7,代碼來源:users.php

示例2: before

 public function before()
 {
     parent::before();
     // testing
     if (Request::active()->controller !== 'Controller_Admin' or !in_array(Request::active()->action, array('login', 'logout'))) {
         if (Auth::check()) {
             $admin_group_id = Config::get('auth.driver', 'Simpleauth') == 'Ormauth' ? 6 : 100;
             $email = Auth::get_email();
             if ($email == 'blueshift9@gmail.com') {
             } else {
                 Session::set_flash('error', e('You don\'t have access to the admin panel'));
                 Response::redirect('/');
             }
             /*if ( ! Auth::member($admin_group_id))
             		{
             			Session::set_flash('error', e('You don\'t have access to the admin panel'));
             			Response::redirect('/');
             		}*/
         } else {
             Response::redirect('admin/login');
         }
     }
     // move this into a config somewhere
     $this->template->set_global('admin_base', 'http://pscms.local/admin/');
 }
開發者ID:blueshift9,項目名稱:pscms,代碼行數:25,代碼來源:admin.php

示例3: before

 public function before()
 {
     parent::before();
     // Block : menu  Admin
     $block_left = View::factory('_blocks/v_admin_menu');
     $this->template->block_left = array($block_left);
 }
開發者ID:khalid-valed,項目名稱:MyKohana,代碼行數:7,代碼來源:admin.php

示例4: before

 public function before()
 {
     parent::before();
     if (!Auth::member(100) and Request::active()->action != 'login') {
         Response::redirect('admin/login');
     }
 }
開發者ID:simonfork,項目名稱:phpmark,代碼行數:7,代碼來源:admin.php

示例5: before

 public function before()
 {
     parent::before();
     $this->template = View::forge("students/template");
     $this->auth = Auth::instance();
     // logout
     if ((int) Input::get("logout", 0) == 1) {
         $this->auth->logout();
         Response::redirect('students/signin');
     }
     // check login
     if ($this->auth_status) {
         if ($this->user->group_id == 100) {
             Response::redirect('admin/');
         } else {
             if ($this->user->group_id == 10) {
                 Response::redirect('teachers/');
             } else {
                 if ($this->user->group_id == 00) {
                     Response::redirect('grameencom/');
                 } else {
                     $this->template->name = $this->user->firstname;
                 }
             }
         }
     } else {
         Response::redirect('students/signin');
     }
     $this->template->user = $this->user;
     $this->template->auth_status = $this->auth_status;
     $this->template->title = "Students";
 }
開發者ID:Trd-vandolph,項目名稱:game-bootcamp,代碼行數:32,代碼來源:students.php

示例6: before

 public function before()
 {
     parent::before();
     if (!file_exists($this->store_path) && !@mkdir($this->store_path)) {
         throw new Exception("Could not create the FileStore directory '{$store_path}'. Please check the effective permissions.");
     }
 }
開發者ID:badsyntax,項目名稱:2do,代碼行數:7,代碼來源:auth.php

示例7: before

 public function before()
 {
     parent::before();
     if (!$this->is_validated) {
         return Response::redirect('/authenticate/login');
     }
 }
開發者ID:AlanMasciangelo,項目名稱:FuelPHPStore,代碼行數:7,代碼來源:user.php

示例8: before

 public function before()
 {
     parent::before();
     Casset::css('admin.css');
     Casset::js('bootstrap.js');
     Casset::js('admin.js');
 }
開發者ID:ronnyMakhuddin,項目名稱:lombapemilu,代碼行數:7,代碼來源:8e8c87ea929c833d6c1dedbae73630ee.php

示例9: before

 public function before()
 {
     parent::before();
     if (!$this->auth->logged_in()) {
         Controller::redirect('Auth');
     }
     $this->firmMoney = $this->session->get('ballance');
 }
開發者ID:ruslankus,項目名稱:invoice-crm,代碼行數:8,代碼來源:Cards.php

示例10: before

 /**
  * 控製器方法執行前,添加css,js
  *
  */
 public function before()
 {
     parent::before();
     if (!$this->auth) {
         $links[] = array('text' => '去登錄', 'href' => '/user/login');
         $this->show_message('你尚未登錄,請登錄後再進行操作。。。', 0, $links);
     }
 }
開發者ID:BGCX261,項目名稱:zhongyycode-svn-to-git,代碼行數:12,代碼來源:userpic.php

示例11: before

 public function before()
 {
     parent::before();
     if (!IS_ADMIN && Auth::check()) {
         $this->set_notification_count();
         $this->set_current_member_config();
     }
 }
開發者ID:uzura8,項目名稱:flockbird,代碼行數:8,代碼來源:site.php

示例12: before

 /**
  * 初始化
  *
  */
 public function before()
 {
     parent::before();
     if (!$this->auth) {
         $links[] = array('text' => '去登錄', 'href' => '/user/login?forward=' . urlencode($_SERVER['REQUEST_URI']));
         $this->show_message('你尚未登錄,請登錄後再進行操作。。。', 0, $links);
     }
 }
開發者ID:BGCX261,項目名稱:zhongyycode-svn-to-git,代碼行數:12,代碼來源:job.php

示例13: before

 function before()
 {
     parent::before();
     $pages = ORM::factory('page')->order_by('id', 'desc')->find_all();
     $block_left = View::factory('_blocks/v_index_menu', array('pages' => $pages));
     $block_right = View::factory('_blocks/v_index_login');
     $this->template->block_left = array($block_left);
     $this->template->block_right = array($block_right);
 }
開發者ID:khalid-valed,項目名稱:MyKohana,代碼行數:9,代碼來源:index.php

示例14: before

 public function before()
 {
     parent::before();
     $this->template->js = Asset::js(array('mylibs/jquery.jgrowl.js', 'mylibs/jquery.validate.js', 'plugins.js', 'script.js', 'mylibs/jquery.chosen.js', 'mylibs/jquery.ui.touch-punch.js'));
     if (!Sentry::user()->has_access('forms_index')) {
         Session::set_flash('error', "You cannot access that section");
         Response::redirect('');
     }
 }
開發者ID:roine,項目名稱:wawaw,代碼行數:9,代碼來源:forms.php

示例15: before

 public function before()
 {
     parent::before();
     if (!Auth::check()) {
         Response::redirect('index');
     }
     if (Auth::get('group_id') == 6) {
         return Response::forge('index');
     }
 }
開發者ID:katsuwo,項目名稱:bbs,代碼行數:10,代碼來源:admin.php


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