Example #1
0
 /**
  * Навещивает обработчики событий
  * @static
  * @param CComponent $object
  * @return object
  *
  */
 public static function attacheHandlers(CComponent &$object)
 {
     $config = SiteHelper::getEventsConfig();
     foreach ($config as $event => $handlers) {
         if (!method_exists(get_class($object), $event)) {
             continue;
         }
         foreach ($handlers as $handler) {
             $object->attachEventHandler($event, $handler);
         }
         // $object->$event = $handler;
     }
 }