?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
Attribute Name | Type | Required | Default | Description |
---|---|---|---|---|
name | string | No | default | The name of the counter |
start | number | No | 1 | The initial number to start counting from |
skip | number | No | 1 | The interval to count by |
direction | string | No | up | the direction to count (up/down) |
boolean | No | true | Whether or not to print the value | |
assign | string | No | n/a | the template variable the output will be assigned to |
屬性 | 類型 | 是否必須 | 缺省值 | 描述 |
---|---|---|---|---|
name | string | No | default | 計(jì)數(shù)器的名稱 |
start | number | No | 1 | 記數(shù)器初始值 |
skip | number | No | 1 | 記數(shù)器間隔、步長 |
direction | string | No | up | 記數(shù)器方向,(增/減) |
boolean | No | true | 是否輸出值 | |
assign | string | No | n/a | 輸出值將被賦給模板變量的名稱 |
counter is used to print out a count. counter will remember the count on each iteration. You can adjust the number, the interval and the direction of the count, as well as determine whether or not to print the value. You can run multiple counters concurrently by supplying a unique name for each one. If you do not supply a name, the name 'default' will be used.
counter 用于輸出一個(gè)記數(shù)過程. counter 保存了每次記數(shù)時(shí)的當(dāng)前記數(shù)值. 用戶可以通過調(diào)節(jié) interval 和 direction 調(diào)節(jié)該值. 也可以決定是否輸出該值. 如果需要同時(shí)運(yùn)行多個(gè)計(jì)數(shù)器,必須為它們指定不同的名稱. 如果沒有指定名稱,模板引擎使用 "default" 作為缺省值.
If you supply the special "assign" attribute, the output of the counter function will be assigned to this template variable instead of being output to the template.
如果指定了 "assign" 這個(gè)特殊屬性,該計(jì)數(shù)器的輸出值將被賦給由 assign 指定的模板變量,而不是直接輸出.
Example 8-2. counter
|