Translations of this page:
 

loopIndex()

The function loopIndex() returns the counter of loopPage() or loopToPage().

int|false loopIndex()

Using loopIndex() is particularly useful in combination with loopToPage(), if the counter is required on a later page within the loop.

// Page 1
$i = loopToPage('page5', 3);
html('<h1>Round '.($i + 1).' of 3</h1>');
 
// Page 2
$i = loopIndex();
html('<h1>Round '.($i + 1).' of 3</h1>');

The function loopIndex() can also be used in the PHP for Processing Responses. However, the command so far always returns false for the first round there. This may have to be taken into account when using it.

en/create/functions/loopindex.txt · Last modified: by 127.0.0.1
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki