← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1757: [xml/dom] Implement magic __toString() method for DOM nodes

 

------------------------------------------------------------
revno: 1757
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Tue 2010-02-16 20:12:28 +0100
message:
  [xml/dom] Implement magic __toString() method for DOM nodes
  
  This means that things like this will work as expected:
  
    echo ax_h1('Hello, world!');
modified:
  xml/dom.lib.php


--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.
=== modified file 'xml/dom.lib.php'
--- xml/dom.lib.php	2010-02-16 19:09:07 +0000
+++ xml/dom.lib.php	2010-02-16 19:12:28 +0000
@@ -1317,6 +1317,16 @@
 		/* Final output */
 		return join('', $out);
 	}
+
+	/**
+	 * Render this element to a string.
+	 *
+	 * \see render
+	 */
+	public function __toString()
+	{
+		return $this->render();
+	}
 }