Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

CSP タグ : <csp:if>

<csp:if><csp:elseif>、および <csp:else> のタグは、CSP ページのフロー内で条件構造を作成します。

MySamplePage.CSP ページの <body></body> のタグの間に、以下のようにコードを追加します。このコードは、条件を使用して OddEvenTest の機能を再作成します。この条件は 10 回実行されるループ内にあります。<body></body> の間にあるその他のコードはすべて削除できます。


<body>
<ul>
<csp:loop counter="i" from="1" to="10" step="1">
  <csp:if condition="i#2=0">
    <li>even</li>
   <csp:else condition="i#2'=0">
    <li>odd</li>
   </csp:else>
  </csp:if>
</csp:loop>
</ul>
</body>

[ビュー]→[ウェブページ] をクリックして、Web ブラウザで MySamplePage.CSP を表示します。

generated description: ifelse20142

FeedbackOpens in a new tab