bindEvent() public méthode

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.
public bindEvent ( string $title = '', string $event = 'click', string $selector = null )
$title string Title of the frame
$event string JavaScript event
$selector string Not all parent will respond to click but only a selector
Exemple #1
0
 /**
  * Add click handler on button, that will execute callback. Similar to
  * onClick, however output from callback execution will appear in a
  * dialog window with a console.
  *
  * @param callable $callback
  * @param string $title
  */
 public function onClickConsole($callback, $title = null)
 {
     if (is_null($title)) {
         $title = $this->template->get('Content');
     }
     $this->virtual_page = $this->add('VirtualPage', ['type' => 'frameURL']);
     /** @type VirtualPage $this->virtual_page */
     $this->virtual_page->bindEvent($title)->set(function ($p) use($callback) {
         /** @type View_Console $console */
         $console = $p->add('View_Console');
         $console->set($callback);
     });
 }