Prev | Current Page 557 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

These options are enabled via function parameters.
Each available option (parameter) is introduced next, concluding with a few
examples.
Two parameters are required:
name: Determines the name of the section. This is arbitrary and should be set to
whatever you deem descriptive of the section??™s purpose.
loop: Sets the number of times the loop will iterate. This should be set to the same
name as the array variable.
Several optional parameters are also available:
start: Determines the index position from which the iteration will begin. For
example, if the array contains five values, and start is set to 3, the iteration will
begin at index offset 3 of the array. If a negative number is supplied, the starting
position will be determined by subtracting that number from the end of the array.
step: Determines the stepping value used to traverse the array. By default, this
value is 1. For example, setting step to 3 will result in iteration taking place on
array indices 0, 3, 6, 9, and so on. Setting step to a negative value will cause the
iteration to begin at the end of the array and work backward.
488 CHAPTER 19 ?–  T EMPLAT I NG WITH SMARTY
max: Determines the maximum number of times loop iteration will occur.
show: Determines whether this section will actually display. You might use this
parameter for debugging purposes, and then set it to FALSE upon deployment.


Pages:
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569