Example #1
0
 /**
  * Bind owner's event (click by default) to a JavaScript chain
  * which would open a new frame (or dialog, depending on $type
  * property), and execute associated code inside it.
  *
  * @param string $title    Title of the frame
  * @param string $event    JavaScript event
  * @param string $selector Not all parent will respond to click but only a selector
  *
  * @return $this
  */
 public function bindEvent($title = '', $event = 'click', $selector = null)
 {
     $t = $this->type;
     if (is_null($event)) {
         $event = 'click';
     }
     $this->owner->on($event, $selector)->univ()->{$t}($title, $this->getURL(), $this->frame_options);
     return $this;
 }