FluentDOM
[ class tree: FluentDOM ] [ index: FluentDOM ] [ all elements ]

Usage Example: FluentDOM::is()

  1. <?php
  2. /**
  3. *
  4. @version $Id: is.php 322 2009-09-14 20:19:48Z subjective $
  5. @license http://www.opensource.org/licenses/mit-license.php The MIT License
  6. @copyright Copyright (c) 2009 Bastian Feder, Thomas Weinert
  7. */
  8. header('Content-type: text/plain');
  9.  
  10. $xml = <<<XML
  11. <html>
  12. <head></head>
  13. <body>
  14.   <form><input type="checkbox" /></form>
  15.   <div></div>
  16. </body>
  17. </html>
  18. XML;
  19.  
  20. require_once('../FluentDOM.php');
  21. $dom FluentDOM($xml);
  22. $isFormParent $dom
  23.   ->find('//input[@type = "checkbox"]')
  24.   ->parent()
  25.   ->is('name() = "form"');
  26. $dom
  27.   ->find('//div')
  28.   ->text('$isFormParent = '.($isFormParent 'TRUE' 'FALSE'));
  29.  
  30. echo $dom;
  31. ?>

Documentation generated on Sun, 26 Sep 2010 01:00:49 +0200 by phpDocumentor 1.4.3