-
Notifications
You must be signed in to change notification settings - Fork 20
Query Data
Thomas Weinert edited this page Jul 31, 2014
·
1 revision
FluentDOM\Query data(string|array $name [, mixed $value = NULL ]);
Read a data attribute from the first node or set data attributes on all selected nodes.
$xml = <<<XML
<div data-role="page" data-hidden="true" data-options='{"name":"John"}'> </div>
XML;
$fd = FluentDOM($xml)->find('//div');
var_dump($fd->data('role'));
var_dump($fd->data('hidden'));
var_dump($fd->data('options')->name);
string(4) "page"
bool(true)
string(4) "John"
- 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