Skip to content

Commit 064d1d5

Browse files
author
Gonzalo Chumillas
committed
Update README.md
1 parent f4ee663 commit 064d1d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@ $xml->clear();
164164
echo $xml;
165165
```
166166

167+
#### Chaining
168+
169+
You can concatenate multiple methods in the same command:
170+
171+
```PHP
172+
$xml = new phpQuery('<root><item id="101" /><item id="102" /><item id="103" /></root>');
173+
// changes and prints the node in the same line
174+
echo $xml->query("item[id = 102]")->attr("title", "Item 101")->text("Some text...")->append("subitem");
175+
```
176+
167177
#### Building XML documents from scratch
168178

169179
You can use phpQuery to create XML documents from scratch. This is a very nice feature if you want to create arbitrary XML documents and want to ensure that the created documents are well formed:

0 commit comments

Comments
 (0)