garretus / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

Per event WebBrowser callbacks #95

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Allow to define different callbacks for WebBrowser plugin based on
triggered event. This can be done (i think) by passing additional event
parameter, something link this (possible parameters collision, just a mockup):
$browser->find('a.my-link')->click(null, array(
  'browser' => array($this, 'callbackMethod')
));
First null means that we're not passing a new event handler.

This enhancement should make work with WebBrowser much more robust.

Original issue reported on code.google.com by tobiasz....@gmail.com on 15 Jan 2009 at 11:03

GoogleCodeExporter commented 8 years ago

Original comment by tobiasz....@gmail.com on 22 Jan 2009 at 6:42

GoogleCodeExporter commented 8 years ago
Added in r344.

Callback has to be passed as first data parameter to trigger (not event shortcut
function). Must be wrapped into Callback class. Example:

->find('a:contains("phpquery")')
  ->trigger('click', array(new Callback('browserClick2')))
->end();

Original comment by tobiasz....@gmail.com on 24 Jan 2009 at 12:11