<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFINCLUDE</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFINCLUDE</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">説明</span>
<p>
CFML 内に ColdFusion ページへのリファレンスを埋め込みます。cfinclude タグは再帰的に埋め込むことができます。CFML をカプセル化する他の方法については、302ページのcfmoduleを参照してください。ColdFusion ページは、以前は ColdFusion テンプレートまたは単にテンプレートと呼ばれることがありました。
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">カテゴリ</span>
<p>
フロー制御タグ、ページ処理タグ
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</span><pre>&lt;cfinclude
   template = &quot;template_name&quot;&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">関連項目</span>
<p>
cfcache、cfflush、cfheader、cfhtmlhead、cfsetting、cfsilent
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">ヒストリ</span>
<p>
ColdFusion&#160;MX: エラーの動作が変更されました。このタグを使用して長さ 0 バイトの CFML ページをインクルードしても、エラーにはなりません。 
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">使用方法</span>
<p>
ColdFusion では、インクルードファイルの検索場所は次のようになります。
</p>
<ol type="1">

<li>現在のページのディレクトリまたは現在のページに関連付けられたディレクトリ</li>

<li>ColdFusion MX Administrator でマップされたディレクトリ</li>
</ol>

<p>
絶対 URL、または含めるファイルのファイルシステムパスを指定することはできません。含まれるページのディレクトリまたは ColdFusion MX Administrator の[マッピング] ページで登録したディレクトリに関連付けられたパスのみを使用することができます。次の cfinclude ステートメントが機能します。指定したディレクトリに &quot;myinclude.cfm&quot; ファイルが存在すると仮定しています。
</p>
<pre>&lt;cfinclude template=&quot;myinclude.cfm&quot;&gt;
&lt;cfinclude template=&quot;../myinclude.cfm&quot;&gt;
&lt;cfinclude template=&quot;/CFIDE/debug/myinclude.cfm&quot;&gt;
</pre>
<p>
ただし、これらは機能しません。
</p>
<pre>&lt;cfinclude template=&quot;C:CFusionMX7wwwrootdoccommentsmyinclude.cfm&quot;&gt;
&lt;cfinclude template=&quot;http://localhost:8500/doccomments/myinclude.cfm&quot;&gt;
</pre>
<p>
インクルードファイルは、正しいシンタックスの完結した CFML ページである必要があります。たとえば、インクルードされるページ内からデータを出力するには、参照する側のページ上ではなく、インクルードされるページ上に cfoutput タグを終了タグも含めて記述する必要があります。同様に、cfif タグを参照側のページとインクルードされるページとの間にまたがらせることはできません。このタグはインクルードされるページ内で完結していなければなりません。
</p>

<p>
次の例に示すように、template 属性に対して変数を指定できます。
</p>
<pre>&lt;cfset templatetouse=&quot;../header/header.cfm&quot;&gt;
&lt;cfinclude template=&quot;#templatetouse#&quot;&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">例</span><pre>&lt;!--- この例では、cfinclude を使用して CFML コードまたは HTML コードを別のページにダイナミックにペース
トする方法を示します。 ---&gt;

&lt;h4&gt;この例では、CFDOCS ディレクトリの dochome.htm ページをインクルードします。イメージは別のディレクト
リに置かれているので表示されません。ただし、ページ自体はこのページのコンテンツ内にすべて表示されます。
&lt;/h4&gt;
&lt;cfinclude template = &quot;../cfdocs/dochome.htm&quot;&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="TEMPLATE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TEMPLATE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ColdFusion ページへの論理パスです。</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
