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


PHP MyController類代碼示例

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


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

示例1: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     # Stop AfterFind actions in Review model
     $this->Review->rankList = false;
 }
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:7,代碼來源:community_reviews_controller.php

示例2: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     $this->jr_lat = Sanitize::getString($this->Config, 'geomaps.latitude');
     $this->jr_lon = Sanitize::getString($this->Config, 'geomaps.longitude');
 }
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:7,代碼來源:module_geomaps_controller.php

示例3: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     # Make configuration available in models
     $this->Listing->Config =& $this->Config;
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:7,代碼來源:listings_controller.php

示例4: beforeFilter

 function beforeFilter()
 {
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     $this->Directory->Config =& $this->Config;
     # Change render controller/view
     $this->viewSuffix = Sanitize::getString($this->params['module'], 'tmpl_suffix');
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:8,代碼來源:module_directories_controller.php

示例5: beforeFilter

 function beforeFilter()
 {
     Configure::write('ListingEdit', false);
     # Call beforeFilter of MyController parent class
     parent::beforeFilter();
     # Stop AfterFind actions in Review model
     $this->Review->rankList = false;
 }
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:8,代碼來源:module_reviews_controller.php

示例6: initializeController

 protected function initializeController()
 {
     if (self::$shouldCallParentAndEcho) {
         parent::initializeController();
         echo 'Controller' . PHP_EOL;
     }
     if (is_null($this->controller)) {
         $this->controller = MyController::getInstance();
     }
 }
開發者ID:quickshiftin,項目名稱:PureMVC-ext,代碼行數:10,代碼來源:MyFacade.php

示例7: __construct

 /**
  * constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->portal = new MyPortal($GLOBALS['identifier']);
     $new_themes = PSUTheme::new_themes($this->portal->person->wp_id);
     $this->tpl->assign('new_themes', $new_themes);
     $this->tpl->body_style_classes[] = 'myplymouth';
     if ($this->portal->is_fluid()) {
         $this->tpl->body_style_classes[] = 'fluid';
     }
     //end if
     MyController::_detect_disabled_chat($this->portal, $this->tpl);
 }
開發者ID:AholibamaSI,項目名稱:plymouth-webapp,代碼行數:16,代碼來源:MyController_tab.class.php

示例8: authenticate

 public function authenticate()
 {
     $user = Player::model()->find('email=:user and password=:pass', array(':user' => $this->username, ':pass' => self::hashpwd($this->password)));
     if ($user) {
         $user->last_login_ip = MyController::getUserHostAddress();
         $user->last_login_time = date('Y-m-d H:i:s');
         $user->login_times++;
         $user->save();
         Yii::app()->user->setState('id', $user->id);
         return true;
     } else {
         return false;
     }
 }
開發者ID:xsir317,項目名稱:5zer,代碼行數:14,代碼來源:MyUserIdentity.php

示例9: actionReg

 public function actionReg()
 {
     $email = trim(Yii::app()->request->getParam('email'));
     $nick = trim(Yii::app()->request->getParam('nickname'));
     $password = trim(Yii::app()->request->getParam('passwd'));
     $password2 = trim(Yii::app()->request->getParam('passwd2'));
     $refer = trim(Yii::app()->request->getParam('refer', '/'));
     if (!preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $email)) {
         $this->json_return(false, '請輸入一個格式正確的Email地址');
     }
     if (!$password || $password != $password2) {
         $this->json_return(false, '2次輸入的密碼不一致');
     }
     if (!$nick) {
         $this->json_return(false, '請填寫昵稱');
     }
     if (mb_strlen($nick, 'UTF-8') > 9) {
         $this->json_return(false, '昵稱長度請限製在9個字之內');
     }
     if (Player::model()->find('email=:email', array(':email' => $email))) {
         $this->json_return(false, '這個Email已經被注冊了,您是否已經注冊過了呢?');
     }
     if (Player::model()->find('nickname=:nick', array(':nick' => $nick))) {
         $this->json_return(false, '這個昵稱已經被注冊了,換一個吧');
     }
     $player = new Player();
     $player->email = $email;
     $player->nickname = $nick;
     $player->password = MyUserIdentity::hashpwd($password);
     $player->login_times = 0;
     $player->b_win = 0;
     $player->b_lose = 0;
     $player->w_win = 0;
     $player->w_lose = 0;
     $player->draw = 0;
     $player->reg_time = date('Y-m-d H:i:s');
     $player->reg_ip = MyController::getUserHostAddress();
     $player->last_login_time = date('Y-m-d H:i:s');
     $player->last_login_ip = MyController::getUserHostAddress();
     $player->score = Yii::app()->params['init_score'];
     if ($player->save()) {
         $identity = new MyUserIdentity($email, $password);
         if ($identity->authenticate()) {
             Yii::app()->user->login($identity, 3600);
             $this->json_return(true, '恭喜您注冊成功!', $refer);
         }
     }
     $this->json_return(false, '注冊失敗啦,請與管理員聯係。');
 }
開發者ID:xsir317,項目名稱:5zer,代碼行數:49,代碼來源:MemberController.php

示例10: init

 public function init()
 {
     parent::init();
     $this->currmenu = 'tournament';
     header("Content-type: text/html; charset=utf-8");
     TournamentTool::refresh_tournaments();
 }
開發者ID:xsir317,項目名稱:5zer,代碼行數:7,代碼來源:TournamentController.php

示例11: beforeFilter

 function beforeFilter()
 {
     $this->name = 'groups';
     // required for admin controllers
     # Call beforeFilter of MyAdminController parent class
     parent::beforeFilter();
 }
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:7,代碼來源:groups_controller.php

示例12: beforeFilter

 function beforeFilter()
 {
     parent::beforeFilter();
     if (Sanitize::getInt($this->data, 'OwnerReply')) {
         $this->review_id = Sanitize::getInt($this->data['OwnerReply'], 'id');
     } else {
         $this->review_id = Sanitize::getInt($this->params, 'review_id');
     }
     if (!$this->Config->owner_replies || $this->review_id == 0 || $this->_user->id == 0) {
         $this->denyAccess = true;
         return;
     }
     // Get the listing id and extension
     $this->_db->setQuery("\n            SELECT \n                Review.pid AS listing_id, Review.`mode` AS extension\n            FROM \n                #__jreviews_comments AS Review\n            WHERE \n                Review.id = " . $this->review_id);
     // Get listing owner id and check if it matches the current user
     if ($listing = current($this->_db->loadAssocList())) {
         // Automagically load and initialize Everywhere Model to check if user is listing owner
         App::import('Model', 'everywhere_' . $listing['extension'], 'jreviews');
         $class_name = inflector::camelize('everywhere_' . $listing['extension']) . 'Model';
         if (class_exists($class_name)) {
             $this->Listing = new $class_name();
             $owner = $this->Listing->getListingOwner($listing['listing_id']);
             if ($this->_user->id != $owner['user_id']) {
                 $this->denyAccess = true;
                 return;
             }
             $this->data['Listing']['created_by'] = $owner['user_id'];
             // Used in the Activities component
             $this->data['Listing']['listing_id'] = $listing['listing_id'];
             // Used in the Activities component
             $this->data['Listing']['extension'] = $listing['extension'];
             // Used in the Activities component
         }
     }
 }
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:35,代碼來源:owner_replies_controller.php

示例13: __construct

 public function __construct()
 {
     parent::__construct();
     $this->_sId = TWILIO_SID;
     $this->_token = TWILIO_TOKEN;
     $this->_number = TWILIO_NUMBER;
     $this->_client = new Services_Twilio($this->_sId, $this->_token);
 }
開發者ID:kukua,項目名稱:kukua-dashboard,代碼行數:8,代碼來源:Sms.php

示例14: beforeFilter

 function beforeFilter()
 {
     parent::beforeFilter();
     $this->viewSuffix = Sanitize::getString($this->params['module'], 'tmpl_suffix');
     # Set Theme
     $this->viewTheme = $this->Config->template;
     $this->viewImages = S2Paths::get($this->app, 'S2_THEMES_URL') . $this->viewTheme . _DS . 'theme_images' . _DS;
 }
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:8,代碼來源:module_fields_controller.php

示例15: afterFilter

 function afterFilter()
 {
     if (isset($this->review_fields)) {
         $Assets = RegisterClass::getInstance('AssetsHelper');
         $Assets->assetParams['review_fields'] = $this->review_fields;
         $Assets->assetParams['owner_id'] = $this->owner_id;
         unset($this->review_fields);
     }
     parent::afterFilter();
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:10,代碼來源:com_content_controller.php


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