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


PHP Cx::getEvents方法代碼示例

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


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

示例1: loadComponent

 /**
  * Load a component (tell it to parse its content)
  * @param string $componentName Name of component to load
  */
 public function loadComponent($componentName)
 {
     $component = $this->findOneBy(array('name' => $componentName));
     $this->cx->getEvents()->triggerEvent('preComponent', array('componentName' => $component->getName(), 'component' => $component, 'hook' => 'load'));
     $component->load($this->cx->getPage());
     $this->cx->getEvents()->triggerEvent('postComponent', array('componentName' => $component->getName(), 'component' => $component, 'hook' => 'load'));
 }
開發者ID:Niggu,項目名稱:cloudrexx,代碼行數:11,代碼來源:SystemComponentRepository.class.php

示例2: __construct

 /**
  * @param $cx Cx
  *
  * @throws \Cx\Core\Event\Controller\EventManagerException
  */
 public function __construct($cx)
 {
     $this->cx = $cx;
     $eventHandlerInstance = $this->cx->getEvents();
     /**
      * Loads all mediatypes into $this->allMediaTypePaths
      */
     $eventHandlerInstance->triggerEvent('mediasource.load', array($this));
     ksort($this->allMediaTypePaths);
     foreach ($this->allMediaTypePaths as $mediaSource) {
         /**
          * @var $mediaSource MediaSource
          */
         if ($mediaSource->checkAccess()) {
             $this->mediaTypePaths[$mediaSource->getName()] = $mediaSource->getDirectory();
             $this->mediaTypes[$mediaSource->getName()] = $mediaSource;
         }
     }
 }
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:24,代碼來源:MediaSourceManager.class.php

示例3: postInit

 /**
  * PostInit hook to add entity validation
  * @param \Cx\Core\Core\Controller\Cx $cx Cx class instance
  */
 public function postInit(\Cx\Core\Core\Controller\Cx $cx)
 {
     // init cx validation
     $cx->getEvents()->addEventListener('model/onFlush', new \Cx\Core\Model\Model\Event\EntityBaseEventListener());
 }
開發者ID:Cloudrexx,項目名稱:cloudrexx,代碼行數:9,代碼來源:ComponentController.class.php


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