matchiterator

Back
Run exampleDownload example
Replaces the returned array labels with corresponding values in unit's source

Context: //app/filters/ob/filter/matchiterator

Remarks:
- unit is a children node of the each xpath node, that will be used as source and multiplied; unit node will be removed from DOM when the multiplying finishes; unit node will be identified by the document processor as the one child having the unit attribute;
- function will return an array of associative arrays; this is mandatory;
array(
0=>array(name => "john", location=>"My City",product=> "My Product"),
1=>array(name => "Max", location=>"His City",product=> "His Product"))
- array labels will be enclosed between AWS_ITERATOR_MATCH_PREFIX and AWS_ITERATOR_MATCH_SUFFIX, then the replacement is made
- AWS_ITERATOR_MATCH_PREFIX and AWS_ITERATOR_MATCH_SUFFIX are defined in defaults.php;
- filter node's first processing instruction holds the function code;
- matchIterator node text content holds xpath;

See also:

Array type in php

Setting up the string to be replaced
Setting up the callback function code

Setting up the document entities - watch youtube video