PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

counter | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

counter

Attribute NameTypeRequiredDefaultDescription
namestringNodefaultThe name of the counter
startnumberNo1The initial number to start counting from
skipnumberNo1The interval to count by
directionstringNoupthe direction to count (up/down)
printbooleanNotrueWhether or not to print the value
assignstringNon/athe template variable the output will be assigned to

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.

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.

Example 8-2. counter

{* initialize the count *}
{counter start=0 skip=2 print=false}

{counter}<br>
{counter}<br>
{counter}<br>
{counter}<br>

OUTPUT:

2<br>
4<br>
6<br>
8<br>
忘却曲線を使ってこの関数を確実に記憶に残す

フォーラムで「counter」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | counter」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: