codegooglecom / querytemplates

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

pq() inside template chain #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
pqt() shortcut to pq(), to easily wrap DOMNodes into QueryTemplates objects
(additional methods available).

Original issue reported on code.google.com by tobiasz....@gmail.com on 24 Feb 2009 at 10:37

GoogleCodeExporter commented 9 years ago

Original comment by tobiasz....@gmail.com on 26 Feb 2009 at 10:43

GoogleCodeExporter commented 9 years ago
pq() should be available in template API as "global find()", so presented 
example can
be achieved, where condition 

pq('#bar')->parents('#foo')->length > 1

is true. Example:

template()->parse('file.htm')
  // stack is document root
  ->find('#bar')
    // stack is #bar
    ->pq('#foo')
      // stack if #foo, although #foo isn't child of #bar
    ->end()
    // stack is #bar again
  ->end()
  // stack is document root
;

Original comment by tobiasz....@gmail.com on 27 Apr 2009 at 6:58