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


PHP CComponent::attachEventHandler方法代碼示例

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


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

示例1: attachNonApiRequestBehaviorsForInstalledApplication

 /**
  * @param CComponent $owner
  */
 protected function attachNonApiRequestBehaviorsForInstalledApplication(CComponent $owner)
 {
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleSetupDatabaseConnection'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadActivitiesObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadConversationsObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadWorkflowsObserver'));
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:10,代碼來源:CommandBeginRequestBehavior.php

示例2: attach

 /**
  * @param CComponent $owner
  */
 public function attach($owner)
 {
     $owner->attachEventHandler('onProductAdded', array($this, 'productAddedEvent'));
     $owner->attachEventHandler('onProductDeleted', array($this, 'productDeletedEvent'));
     $owner->attachEventHandler('onProductQuantityChanged', array($this, 'onProductQuantityChanged'));
     parent::attach($owner);
 }
開發者ID:kolbensky,項目名稱:rybolove,代碼行數:10,代碼來源:HistoricalBehavior.php

示例3: attach

 /**
  * @param \CComponent $component
  * @param string $action
  * @param string $beginEventName
  * @param string $endEventName
  */
 public function attach(\CComponent $component, $action, $beginEventName, $endEventName)
 {
     $component->attachEventHandler($beginEventName, function (\CEvent $event) use($action) {
         $this->handleBegin($event, $action);
     });
     $component->attachEventHandler($endEventName, function (\CEvent $event) use($action) {
         $this->handleEnd($event, $action);
     });
 }
開發者ID:bankiru,項目名稱:yii-pinba,代碼行數:15,代碼來源:EventHandler.php

示例4: attach

 /**
  * Attaches the behavior object to the component.
  * The default implementation will set the {@link owner} property
  * and attach event handlers as declared in {@link events}.
  * Make sure you call the parent implementation if you override this method.
  * @param CComponent $owner the component that this behavior is to be attached to.
  */
 public function attach($owner)
 {
     $this->_owner = $owner;
     foreach ($this->events() as $event => $handler) {
         $owner->attachEventHandler($event, array($this, $handler));
     }
 }
開發者ID:jicheng17,項目名稱:yiifamilyblog,代碼行數:14,代碼來源:CBehavior.php

示例5: attach

 /**
  * Подключение события
  * @param CComponent $owner - 'хозяин' события
  * @return void
  */
 public function attach($owner)
 {
     $this->lm = $owner->getUrlManager();
     if (is_array($this->lm->languages) && count($this->lm->languages) > 1) {
         $owner->attachEventHandler('onBeginRequest', [$this, 'handleLanguageBehavior']);
     }
 }
開發者ID:alextravin,項目名稱:yupe,代碼行數:12,代碼來源:LanguageBehavior.php

示例6: attach

 /**
  * Attaches the behavior object to the component.
  * The default implementation will set the {@link owner} property
  * and attach event handlers as declared in {@link events}.
  * Make sure you've declared handler as public and call the parent implementation if you override this method.
  * @param CComponent $owner the component that this behavior is to be attached to.
  */
 public function attach($owner)
 {
     $this->_owner = $owner;
     $class = new ReflectionClass($this);
     foreach ($this->events() as $event => $handler) {
         if (!$class->getMethod($handler)->isProtected()) {
             $owner->attachEventHandler($event, array($this, $handler));
         }
     }
 }
開發者ID:salem-dev-acc,項目名稱:yiiapp,代碼行數:17,代碼來源:CBehavior.php

示例7: attachNonApiRequestBehaviorsForInstalledApplication

 /**
  * @param CComponent $owner
  */
 protected function attachNonApiRequestBehaviorsForInstalledApplication(CComponent $owner)
 {
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleSetupDatabaseConnection'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadActivitiesObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadConversationsObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadEmailMessagesObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadWorkflowsObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadReadPermissionSubscriptionObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadAccountContactAffiliationObserver'));
 }
開發者ID:KulturedKitsch,項目名稱:kulturedkitsch.info,代碼行數:13,代碼來源:CommandBeginRequestBehavior.php

示例8: attachNonApiRequestBehaviorsForInstalledApplication

 protected function attachNonApiRequestBehaviorsForInstalledApplication(CComponent $owner)
 {
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleSetupDatabaseConnection'));
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:4,代碼來源:CommandBeginRequestBehavior.php

示例9: attachNonApiRequestBehaviorsForInstalledApplication

 /**
  * @see CommandBeginRequestBehavior, make sure if you change this array, you add anything needed
  * for the command behavior as well.
  * @param CComponent $owner
  */
 protected function attachNonApiRequestBehaviorsForInstalledApplication(CComponent $owner)
 {
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleSetupDatabaseConnection'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleBeginRequest'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleClearCache'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadLanguage'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadTimeZone'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleUserTimeZoneConfirmed'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadActivitiesObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadConversationsObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadEmailMessagesObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadContactLatestActivityDateTimeObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadAccountLatestActivityDateTimeObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadWorkflowsObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadReadPermissionSubscriptionObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadAccountContactAffiliationObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadGamification'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleCheckAndUpdateCurrencyRates'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleResolveCustomData'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handlePublishLogoAssets'));
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:26,代碼來源:BeginRequestBehavior.php

示例10: attachEventHandler

 /**
  * Attach event handler
  *
  * @param string $name Event name
  * @param mixed $handler Event handler
  */
 public function attachEventHandler($name, $handler)
 {
     self::$_events[] = array('component' => get_class($this), 'name' => $name, 'handler' => $handler);
     parent::attachEventHandler($name, $handler);
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:11,代碼來源:ObservableComponent.php

示例11: attachNonApiRequestBehaviorsForInstalledApplication

 protected function attachNonApiRequestBehaviorsForInstalledApplication(CComponent $owner)
 {
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleSetupDatabaseConnection'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleCheckAutoBuildCompleted'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleBeginRequest'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleClearCache'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadLanguage'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadTimeZone'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleUserTimeZoneConfirmed'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadActivitiesObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadConversationsObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadWorkflowsObserver'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLoadGamification'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleCheckAndUpdateCurrencyRates'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleResolveCustomData'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handlePublishLogoAssets'));
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:17,代碼來源:BeginRequestBehavior.php


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