pc-magas / phpquery

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

collectData() method #111

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
collectData(&$target, $method = 'text', $callbacks = null)
// $method can be an array, then >= [1] are params
// $callbacks can be an array, but dont support params (curried callbacks
do the thing)

$node = pq('tr td:nth-child(1)');
$data = array();
$node->next()->
  find('span')->
    eq(0)->
      collectData($data)    ->  // text
    end()->
    eq(1)->
      collectData($data, 'text', 'trim')->
    end()->
    eq(2)->
      collectData($data, 'markupOuter')->
    end()->
  end()
;

Original issue reported on code.google.com by tobiasz....@gmail.com on 3 Apr 2009 at 10:22