Public Member Functions | |
| __construct ($sequence) | |
| Constructs a new AnewtGenerator instance. | |
| next () | |
| Returns the next value from the sequence. | |
Private Attributes | |
| $sequence | |
| The sequence this AnewtGenerator iterates over. | |
| $counter = 0 | |
| The number of times the next() method has been called. | |
A generator can be used to generate strings from a sequence. This is useful for e.g. zebra-pattern row listings.
Definition at line 17 of file generator.lib.php.
| AnewtGenerator::__construct | ( | $ | sequence | ) |
Constructs a new AnewtGenerator instance.
You should pass the sequence to use, which can be an array array containing values or, alternatively, multiple parameters.
Example of using a single array:
$g = new AnewtGenerator(array('a', 'b', 'c'));
Example of using multiple parameters:
$g = new AnewtGenerator('a', 'b', 'c');
| $sequence | An array with sequence values or multiple parameters that will be used as a sequence. |
Definition at line 40 of file generator.lib.php.
1.5.9