-
Notifications
You must be signed in to change notification settings - Fork 20
Query PrependTo
Thomas Weinert edited this page Jul 31, 2014
·
1 revision
FluentDOM\Query prependTo(string|array|\DOMNode|\DOMNodeList|Query $selector);
Prepend all of the matched elements to another, specified, set of elements. Returns all of the inserted elements.
$html = <<<HTML
<html>
<head>
<title>Examples: FluentDOM\Query::prependTo()</title>
</head>
<body>
<div id="foo">Yellow! </div>
<span>He thought </span>
</body>
</html>
HTML;
echo FluentDOM($html)
->find('//span')
->prependTo('//div[@id = "foo"]');
<?xml version="1.0"?>
<html>
<head>
<title>Examples: FluentDOM\Query::prependTo()</title>
</head>
<body>
<div id="foo"><span>He thought </span>Yellow! </div>
</body>
</html>
- Home
- Getting Started
- Tasks
- Plugins
- Functions
- Lists
- Creator (5.1)
- CSS Selectors
- Convertors
- Loaders
- Serializers (5.1)
- Transformers (5.1)
- Extended DOM
- XMLReader (6.1)
- XMLWriter (6.1)
- Interfaces