Replies: 1 comment 1 reply
-
You have different options depending on the exact task you have to accomplish. To iterate all rows and all columns, in batch, you can: $rows = $fxml->query('//tr');
$cols = $fxml->query('//td');
$rows->each(function ($idx) {
});
$cols->each(function ($idx) {
}); To do a depth traversal (a row first, then its columns), you can: $fxml->query('//tr')->each(function ($rowIdx) {
$this->query('./td')->each(function ($colIdx) {
});
});
Exactly because it is a FluidContext, you have the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to do multi level iterations.
ie. I want to select all the rows (
tr
). Iterate over each row. Then select the columns (td
).I can't see an easy way to do it with the methods available.
eg. Given the following html doc:
To select the rows I would:
Now I want to select the columns based on the
$rows
resultIdeally, I was thinking along the lines of:
But I know that
$this
in the closure is aFluidContext
object and doesn't have thequery
method.Is there any other way to do it that I'm not aware of?
Beta Was this translation helpful? Give feedback.
All reactions