当前位置: 首页>>代码示例>>PHP>>正文


PHP CComponent::detachEventHandler方法代码示例

本文整理汇总了PHP中CComponent::detachEventHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP CComponent::detachEventHandler方法的具体用法?PHP CComponent::detachEventHandler怎么用?PHP CComponent::detachEventHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComponent的用法示例。


在下文中一共展示了CComponent::detachEventHandler方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: detach

 /**
  * Detaches the behavior object from the component.
  * The default implementation will unset the {@link owner} property
  * and detach event handlers 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 detached from.
  */
 public function detach($owner)
 {
     foreach ($this->events() as $event => $handler) {
         $owner->detachEventHandler($event, array($this, $handler));
     }
     $this->_owner = null;
 }
开发者ID:jicheng17,项目名称:yiifamilyblog,代码行数:14,代码来源:CBehavior.php

示例2: detach

 /**
  * Detaches the behavior object from the component.
  * The default implementation will unset the {@link owner} property
  * and detach event handlers declared in {@link events}.
  * This method will also set {@link enabled} to false.
  * Make sure you call the parent implementation if you override this method.
  * @param CComponent $owner the component that this behavior is to be detached from.
  */
 public function detach($owner)
 {
     foreach ($this->events() as $event => $handler) {
         $owner->detachEventHandler($event, [$this, $handler]);
     }
     $this->_owner = null;
     $this->_enabled = false;
 }
开发者ID:astar3086,项目名称:studio_logistic,代码行数:16,代码来源:Behavior.php

示例3: attachApiRequestBehaviors

 protected function attachApiRequestBehaviors(CComponent $owner)
 {
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleSentryLogs'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleApplicationCache'));
     $owner->detachEventHandler('onBeginRequest', array(Yii::app()->request, 'validateCsrfToken'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleImports'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleSetupDatabaseConnection'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleDisableGamification'));
     $this->resolveBeginApiRequest($owner);
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleLibraryCompatibilityCheck'));
     $owner->attachEventHandler('onBeginRequest', array($this, 'handleStartPerformanceClock'));
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:12,代码来源:BeginRequestBehavior.php

示例4: detachEventHandler

 /**
  * Dettach event hander
  *
  * @param string $name Event name
  * @param mixed $handler Event handler
  * @return bool
  */
 public function detachEventHandler($name, $handler)
 {
     foreach (self::$_events as $index => $event) {
         // when comparing 2 objects use === instead of ==
         // why? http://www.richardlord.net/blog/php-nesting-level-too-deep-recursive-dependency
         if ($event['name'] == $name && $event['handler'] === $handler) {
             unset(self::$_events[$index]);
         }
     }
     return parent::detachEventHandler($name, $handler);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:18,代码来源:ObservableComponent.php

示例5: detachEventHandler

 /**
  * Dettach event hander
  *
  * @param string $name Event name
  * @param mixed $handler Event handler
  * @return bool
  */
 public function detachEventHandler($name, $handler)
 {
     foreach (self::$_events as $index => $event) {
         if ($event['name'] == $name && $event['handler'] == $handler) {
             unset(self::$_events[$index]);
         }
     }
     return parent::detachEventHandler($name, $handler);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:16,代码来源:ObservableComponent.php


注:本文中的CComponent::detachEventHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。