<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
 >

  <channel rdf:about="http://sourceforge.jp/projects/simplate/wiki/!feeds/list">
    <title>simplate Wiki</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/!feeds/list</link>
    <description>
      SourceForge.jp Wiki pages for simplate project.    </description>
        <dc:date>2010-08-27T16:40:22+09:00</dc:date>
        <items>
      <rdf:Seq>
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/FrontPage" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Install" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Appendix" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Advanced" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Caching" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.functions" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Variable" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Features" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Started" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/NavigationList" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Caching.setup" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function" />
                <rdf:li rdf:resource="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute" />
              </rdf:Seq>
    </items>
  </channel>

      <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/FrontPage">
    <title>FrontPage</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/FrontPage</link>
    <dc:identifier>FrontPage</dc:identifier>
    <dc:date>2010-08-27T16:40:22+09:00</dc:date>
        <description>
      <![CDATA[以下、http://simplate.aimy.jp/ より転記、加筆、修正。

[[PageOutline(start=3, depth=2, type=unorderd)]]

=== Simplate ===

Simplate は、php でよく使われている Smarty テンプレートエンジンを参考にして、
php extension として動作するようにしたものです。簡単に]]>
    </description>
    <content:encoded>
      <![CDATA[<p>以下、<a href="http://simplate.aimy.jp/" class="external" rel="nofollow">http://simplate.aimy.jp/</a> より転記、加筆、修正。
</p><div class="pageoutline"><div class="pageoutline-title"><div class="action"><button type="button" onClick="javascript:togglePageOutline(this)"><img src="//static.sourceforge.jp/wiki/images/icons/roll-up.gif" border="0"></button></div>Outline</div><ol><li><a href="#h3-Simplate">Simplate</a>
<ol><li><a href="#h4-.E5.8B.95.E4.BD.9C.E7.92.B0.E5.A2.83">動作環境</a>
</li><li><a href="#h4-Licenses">Licenses</a>
</li></ol></li><li><a href="#h3-.E6.9C.80.E6.96.B0.E3.83.AA.E3.83.AA.E3.83.BC.E3.82.B9.20.28.E3.83.80.E3.82.A6.E3.83.B3.E3.83.AD.E3.83.BC.E3.83.89.29">最新リリース (ダウンロード)</a>
</li><li><a href="#h3-.E3.83.9E.E3.83.8B.E3.83.A5.E3.82.A2.E3.83.AB">マニュアル</a>
</li><li><a href="#h3-.E3.81.8A.E5.95.8F.E5.90.88.E3.81.9B.E5.85.88">お問合せ先</a>
</li></ol></div>
<h3 id="h3-Simplate">Simplate</h3><p>Simplate は、php でよく使われている Smarty テンプレートエンジンを参考にして、
php extension として動作するようにしたものです。簡単にいうと php extension のテンプレートエンジンです。
ただ、Smarty は、かなり高機能ですが、動作が遅いので、Simplate は、逆に機能はあまりつけず、高速に動作します。
</p><h4 id="h4-.E5.8B.95.E4.BD.9C.E7.92.B0.E5.A2.83">動作環境</h4><p>Linux, FreeBSD, MacOSX, Windows
PHP4,5 ともに動作すると思いますが、最近は、PHP4 の環境は試していません。
</p><h4 id="h4-Licenses">Licenses</h4><p>ライセンスについては、<strong>BSDライセンス</strong>です。
</p><ul><li><a href="http://sourceforge.jp/projects/simplate/svn/view/trunk/LICENSE?view=markup&amp;root=simplate">LICENSE</a>
</li></ul><h3 id="h3-.E6.9C.80.E6.96.B0.E3.83.AA.E3.83.AA.E3.83.BC.E3.82.B9.20.28.E3.83.80.E3.82.A6.E3.83.B3.E3.83.AD.E3.83.BC.E3.83.89.29">最新リリース (ダウンロード)</h3><script src="/projects/simplate/files/compact.js" type="text/javascript" charset="utf-8"></script>
<ul><li><a href="http://sourceforge.jp/projects/simplate/svn/view/trunk/ChangeLog?view=markup&amp;root=simplate">ChangeLog</a>
</li></ul><h3 id="h3-.E3.83.9E.E3.83.8B.E3.83.A5.E3.82.A2.E3.83.AB">マニュアル</h3><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Features">Simplate とは？</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Install">インストール</a>
</li></ul></li></ul><h5 id="h5-.E9.96.A2.E9.80.A3.E3.83.AA.E3.83.B3.E3.82.AF">関連リンク</h5><ul><li><a href="http://groups.google.com/group/simplate" class="external" rel="nofollow">ユーザーグループ</a>
</li><li><a href="http://simplate.mw.aimy.jp" class="external" rel="nofollow">開発者のブログ</a>
</li><li><a href="http://www.asial.co.jp/company/files/Smarty2006.pdf" class="external" rel="nofollow">アシアルによる Smarty のドキュメントに Simplate のベンチがあります</a>
</li><li><a href="http://www.phppro.jp/phptips/archives/vol39/" class="external" rel="nofollow">PHP プロ Tips ML</a>
</li><li><del> ttp://marijuana.ddo.jp/modules/downloads/index.php?action=visit&amp;cid=3&amp;lid=7 Marijuana さんによる Windows 版 dll ファイル </del>
</li><li><del> ttp://blog.veax.net/index.php/2006/02/04/9-simplate 清水さんによる Windows 版 VisaulC++ 2005 <a href="http://sourceforge.jp/projects/simplate/wiki/ExpressEdition">ExpressEdition</a> 用プロジェクトファイル
PHP 自体のコンパイルを必要としない設定になっていますが、必要があればプロジェクトプロパティを環境に合わせて設定してください。</del>
<ul><li>Micrsoft Visual C++ 2005 Express Edition 用プロジェクトファイルはリリースファイルに同梱されています
</li><li>Windows 版 dll ファイルは同梱していませんが、<a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows">コンパイル手順を記述</a> しました。
</li><li>@love_marijuana さんがコンパイルした Windows 版 dll (PHP5.2.14&amp;PHP5.3.3) は <a href="http://marijuana.xsrv.jp/index.php?moddir=downloads&amp;action=single&amp;lid=10&amp;cid=3" class="external" rel="nofollow">こちらからダウンロード</a> できます。
</li></ul></li><li><a href="http://www.revulo.com/PHP/Extension/Simplate/Hack.html" class="external" rel="nofollow">revulo さんによる自動的に HTML エスケープさせるパッチ</a>
</li><li><a href="http://simplate.aimy.jp/archive/php-simplate-0.3.6-1.src.rpm" class="external" rel="nofollow">SRPMファイル</a>
</li><li><a href="http://simplate.aimy.jp/archive/example.tar.gz" class="external" rel="nofollow">デモコード</a>
</li></ul><h5 id="h5-.E5.8B.95.E4.BD.9C.E5.AE.9F.E7.B8.BE">動作実績</h5><p>他にもこんなところで使っていますというのがあれば、<a href="http://sourceforge.jp/forum/forum.php?forum_id=16143">こちら</a> まで、お知らせください。
</p><ul><li><a href="http://c.aimy.jp/" class="external" rel="nofollow">来来中国語</a>
</li><li><a href="http://mw.aimy.jp/" class="external" rel="nofollow">Media Wagon</a>
</li><li><a href="http://tr.aimy.jp/" class="external" rel="nofollow">Social Translation</a>
</li><li>大手ポータルサイト○ooのいくつかのサービス (1 日につき、数百万 PV の規模)
</li><li>Ethna からも Simplate が使えるようです <a href="http://www.revulo.com/Ethna/Hack/Simplate.html" class="external" rel="nofollow">Ethna パッチ</a>
</li></ul><h5 id="h5-.E9.96.A2.E9.80.A3.E3.83.97.E3.83.AD.E3.83.80.E3.82.AF.E3.83.88">関連プロダクト</h5><ul><li><a href="http://sourceforge.jp/projects/simframe/" class="project">Simframe</a> php extension で書かれた Rails 風フレームワーク (php extension ではなくスクリプト版としても使えます。)
</li></ul><h3 id="h3-.E3.81.8A.E5.95.8F.E5.90.88.E3.81.9B.E5.85.88">お問合せ先</h3><p><a href="http://sourceforge.jp/forum/forum.php?forum_id=16143">こちらのフォーラム</a> でどうぞ。
</p><script type="text/javascript"><!--
google_ad_client = "pub-9941151214016196";google_ad_slot = "7426463671";google_ad_width = 300;google_ad_height = 250;//-->
</script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal">
    <title>Builtin.functions.literal</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal</link>
    <dc:identifier>Builtin.functions.literal</dc:identifier>
    <dc:date>2010-03-14T23:08:59+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== &lt;{literal}&gt; ===

&lt;{literal}&gt; タグに囲まれたデータのブロックは、リテラルとして認識されます。これは一般的に、Javascript やスタイルシートなどで中括弧がテンプレートの [デリミタ] として解釈されるとまずい場合に使用します。ただし、Simplate の場合はデフォ]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">&lt;{include}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">&lt;{php}&gt;</a>
</div></div>
<h3 id="h3-.3C.7Bliteral.7D.3E">&lt;{literal}&gt;</h3><p>&lt;{literal}&gt; タグに囲まれたデータのブロックは、リテラルとして認識されます。これは一般的に、Javascript やスタイルシートなどで中括弧がテンプレートの <a href="http://sourceforge.jp/projects/simplate/wiki/%E3%83%87%E3%83%AA%E3%83%9F%E3%82%BF">デリミタ</a> として解釈されるとまずい場合に使用します。ただし、Simplate の場合はデフォルトデリミタが &lt;{ }&gt; なので、通常、&lt;{literal}&gt; タグを使用することはありません。&lt;{literal}&gt;&lt;{/literal}&gt; タグの内部は解釈されず、そのままで表示されます。
</p><h5 id="h5-.E4.BE.8B..20.3C.7Bliteral.7D.3E.20.E3.82.BF.E3.82.B0">例. &lt;{literal}&gt; タグ</h5><pre>&lt;{literal}&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
function isblank(field)
{
  if (field.value == ''){
    return false;
  } else {
    document.loginform.submit();
    return true;
  }
}
// --&gt;
&lt;/script&gt;
&lt;{/literal}&gt;
</pre><h5 id="h5-.E4.BE.8B..20Javascript.20.E3.81.AE.E9.96.A2.E6.95.B0.E3.81.AE.E4.BE.8B">例. Javascript の関数の例</h5><pre>&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
&lt;{literal}&gt;
function myJsFunction(name, ip)
{
  alert(&quot;The server name\n&quot; + name + &quot;\n&quot; + ip);
}
&lt;{/literal}&gt;
&lt;/script&gt;
&lt;a href=&quot;javascript:myJsFunction('&lt;{$SERVER_NAME}&gt;', '&lt;{$SERVER_ADDR}&gt;')&quot;&gt;Click here for the Server Info&lt;/a&gt;
</pre><h5 id="h5-.E4.BE.8B..20.E3.83.86.E3.83.B3.E3.83.97.E3.83.AC.E3.83.BC.E3.83.88.E5.86.85.E3.81.A7.E3.81.AE.20css.20style">例. テンプレート内での css style</h5><pre>&lt;{* included this style .. as an experiment *}&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;{literal}&gt;
/* this is an intersting idea for this section */
.madIdea{
    border: 3px outset #ffffff;
    margin: 2 3 4 5px;
    background-color: #001122;
}
&lt;{/literal}&gt;
&lt;/style&gt;
&lt;div class=&quot;madIdea&quot;&gt;With smarty you can embed CSS in the template&lt;/div&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">&lt;{include}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">&lt;{php}&gt;</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Install">
    <title>Install</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Install</link>
    <dc:identifier>Install</dc:identifier>
    <dc:date>2010-01-13T01:12:35+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 2章 インストール ===

==== 必要条件 ====

Simplate は、PHP 4.3 以降が動作しているウェブサーバを必要とします。ただし、PHP5 を推奨します (現在は、PHP4 系の開発環境を用意していません)。php extension がコンパイルできるツールが存在する必要があります (ソースか]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Started">I. はじめに</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Features">1章 Simplate とは？</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows">Windows でのインストール</a>
</div></div>
<h3 id="h3-2.E7.AB.A0.20.E3.82.A4.E3.83.B3.E3.82.B9.E3.83.88.E3.83.BC.E3.83.AB">2章 インストール</h3><h4 id="h4-.E5.BF.85.E8.A6.81.E6.9D.A1.E4.BB.B6">必要条件</h4><p>Simplate は、PHP 4.3 以降が動作しているウェブサーバを必要とします。ただし、PHP5 を推奨します (現在は、PHP4 系の開発環境を用意していません)。php extension がコンパイルできるツールが存在する必要があります (ソースから PHP をコンパイルしている場合、多分既に環境が整っています)。
</p><h4 id="h4-.E3.82.A4.E3.83.B3.E3.82.B9.E3.83.88.E3.83.BC.E3.83.AB">インストール</h4><p>Simplate は php extension です。以下の手順でコンパイル &amp; インストールすることができます。
</p><ol><li>Simplate のファイル取得
</li><li>ファイルの展開
</li><li>phpize により、コンパイルの前準備
</li><li>コンパイル
</li><li>インストール (場合によっては、root 権限が必要です)
</li><li>php.ini ファイルに extension=&quot;simplate.so&quot; を追加する。
</li><li>Apache などの Web サーバを再起動する。
</li></ol><p>上記の手順は、次のようなコマンドによって実行します。
<pre>$ wget 'http://sourceforge.jp/frs/redir.php?m=iij&amp;f=%2Fsimplate%2F43613%2Fsimplate-X.Y.Z.tar.gz'
$ tar zxvf simplate-X.Y.Z.tar.gz
$ cd simplate-X.Y.Z
$ phpize
$ ./configure --enable-simplate
$ make ( or gmake)
$ sudo make (or gmake) install
</pre></p><h4 id="h4-.E5.8B.95.E4.BD.9C.E7.A2.BA.E8.AA.8D">動作確認</h4><p>次のようなコマンドを実行して、enabled が返ってきていれば、インストールに成功しています。
</p><pre>$ php -i | grep -i 'simplate' -A 1
simplate

simplate support =&gt; enabled
Version =&gt; X.Y.Z
</pre><p>ブラウザからのリクエストで phpinfo() を実行し、enabled が存在しない場合は Web サーバを再起動したか確認してください。
</p><h4 id="h4-.E7.92.B0.E5.A2.83.E6.A7.8B.E7.AF.89">環境構築</h4><p>今度はあなたのアプリケーション内に Simplate 用のディレクトリをセットアップしましょう。
</p><ul><li>Simplate は、デフォルトで template/、template_c/ と名付けられた 2 つのディレクトリが必要です。
</li><li>これらの名前は、それぞれ Simplate クラスのプロパティ <a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$template_dir</a>、<a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a> で定義することができます。
</li><li>Simplate を使用する各アプリケーションにおいて、これらのディレクトリを個別に設置することを強く推奨します。
</li></ul><p>インストール例として、ゲストブックアプリケーションの Simplate 環境をセットアップしてみます。
私たちはディレクトリの命名規則の目的についてのみ取り上げました。
例のアプリケーション名を guestbook/ からあなたのアプリケーション名に置き換えれば、同様の環境を使用できます。
</p><h5 id="h5-.E4.BE.8B..20.E3.83.95.E3.82.A1.E3.82.A4.E3.83.AB.E6.A7.8B.E9.80.A0">例. ファイル構造</h5><pre>/web/www.example.com/
        guestbook/
                template/
                    index.tpl
                template_c/
                htdocs/
                    index.php
</pre><p>あなたは Web サーバのドキュメントルートの位置を知っている必要があります。
例ではドキュメントルートは /web/www.example.com/guestbook/htdocs/ とします
</p><p>ドキュメントルート下には最低１つのファイルが必要であり、それは Web ブラウザによってアクセスされるスクリプトです。
この例ではドキュメントルート /htdocs/ の下にサブディレクトリを作成し、その中に index.php を配置します。
</p><p>Smarty は <a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a> (template_c/) に <strong>書き込み権限</strong> でアクセスする必要があるので、
Web サーバのユーザがこれらに書き込める必要があります。
</p><div class="indent">注意: Apache を使用しているなら、httpd.conf ファイルを見ればユーザ名とグループ名がわかります。
</div><h5 id="h5-.E4.BE.8B..20.E3.83.91.E3.83.BC.E3.83.9F.E3.83.83.E3.82.B7.E3.83.A7.E3.83.B3.E3.81.8A.E3.82.88.E3.81.B3.E3.83.87.E3.82.A3.E3.83.AC.E3.82.AF.E3.83.88.E3.83.AA.E3.81.B8.E3.81.AE.E6.9B.B8.E3.81.8D.E8.BE.BC.E3.81.BF.E6.A8.A9.E9.99.90.E3.81.AE.E4.BB.98.E4.B8.8E">例. パーミッションおよびディレクトリへの書き込み権限の付与</h5><pre>chown apache:apache /web/www.example.com/guestbook/templates_c/
chmod 770 /web/www.example.com/guestbook/templates_c/
</pre><div class="indent">注意: chmod 770 は強固なセキュリティです。 これは、ユーザ &quot;apache&quot; とグループ &quot;apache&quot; のみにディレクトリのリード/ライトアクセスを許可します。もし誰にでもリードアクセスを可能にしたい場合 (大抵はあなた自身がファイルを見るための利便性から) は、代わりに 775 を使う事が出来ます。
</div><p>次に、Simplate が表示するファイル index.tpl を作成する必要があります。これは、<a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$template_dir</a> の中に配置しなければなりません。
</p><h5 id="h5-.E4.BE.8B..20.2Fweb.2Fwww.example.com.2Fguestbook.2Ftemplates.2Findex.tpl">例. /web/www.example.com/guestbook/templates/index.tpl</h5><pre>&lt;{* Simplate *}&gt;

こんにちは、&lt;{$name}&gt;。ようこそ Simplate へ!
</pre><div class="indent">テクニカルノート: &lt;{* Simplate *}&gt; はテンプレートの <a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">コメント</a> です。これは必須ではありませんが、全てのテンプレートファイルのはじめにコメントを書くのは良い習慣です。これは、ファイルの拡張子に関わらずファイルを認識する事を簡単にします。例えば、テキストエディタはファイルを認識して特有のシンタックスハイライトを有効にするでしょう。
</div><p>では、index.php を編集しましょう。Simplate のインスタンスを作成し、テンプレート変数を割り当て (<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a>)、index.tpl ファイルを表示 (<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a>) します。
</p><h5 id="h5-.E4.BE.8B..20.2Fweb.2Fwww.example.com.2Fdocs.2Fguestbook.2Findex.php.20.E3.81.AE.E7.B7.A8.E9.9B.86">例. /web/www.example.com/docs/guestbook/index.php の編集</h5><pre>&lt;?php

if (!extension_loaded('simplate')) { dl('simplate.so'); }

$simplate =&amp; new simplate();
$simplate-&gt;template_dir = '/web/www.example.com/guestbook/templates/';
$simplate-&gt;compile_dir  = '/web/www.example.com/guestbook/templates_c/';
$simplate-&gt;assign('name','You');
$simplate-&gt;display('index.tpl');
?&gt;
</pre><p>では、Web ブラウザから index.php ファイルを読み込んでみましょう。
&quot;こんにちは、You。ようこそ Simplate へ!&quot; と表示されるはずです。
</p><p>これで Simplate のセットアップは完了しました！ 
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Started">I. はじめに</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Features">1章 Simplate とは？</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows">Windows でのインストール</a>
</div></div>
]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer">
    <title>Simpalte.for.developer</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer</link>
    <dc:identifier>Simpalte.for.developer</dc:identifier>
    <dc:date>2010-01-13T01:11:06+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== IV. 開発者のための Simlate ===

==== 目次 ====

 * リリース手順
 * make test
 * デバッグログ

==== リリース手順 ====

ソースコード中の define 定義されている VERSION を修正します。

{{{ code
#define VE]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Appendix">V. 付録</a>
</div></div>
<h3 id="h3-IV..20.E9.96.8B.E7.99.BA.E8.80.85.E3.81.AE.E3.81.9F.E3.82.81.E3.81.AE.20Simlate">IV. 開発者のための Simlate</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li>リリース手順
</li><li>make test
</li><li>デバッグログ
</li></ul><h4 id="h4-.E3.83.AA.E3.83.AA.E3.83.BC.E3.82.B9.E6.89.8B.E9.A0.86">リリース手順</h4><p>ソースコード中の define 定義されている VERSION を修正します。
</p><pre>#define VERSION &quot;X.Y.Z&quot;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/ChangeLog">ChangeLog</a> を記述し、make、make test を実行して最終確認したらコミットします。
</p><pre>$ make
$ make test
$ sudo make install
$ php -i | grep -i 'simplate' -A 1
$ svn ci -m 'X.Y.Z release'
</pre><p>続いてタグ付けをします。
</p><pre>$ svn copy https://svn.sourceforge.jp/svnroot/simplate/trunk https://svn.sourceforge.jp/svnroot/simplate/tags/simplate-X.Y.Z -m 'Release X.Y.Z'
</pre><p><a href="http://sourceforge.jp/projects/simplate/svn/view/tags/simplate-X.Y.Z">http://sourceforge.jp/projects/simplate/svn/view/tags/simplate-X.Y.Z</a> にアクセスし、tag の内容を確認した上で <strong>Download GNU tarball</strong> をクリックし、simplate-X.Y.Z.tar.gz をダウンロードします。
ダウンロードした tarball を使用して <a href="http://sourceforge.jp/projects/simplate/wiki/Install">インストール手順</a> に従い、コンパイル &amp; インストール &amp; バージョンの確認をします。
</p><p><a href="http://sourceforge.jp/projects/simplate/wiki/SourceForge">SourceForge</a> のメニュ「ダウンロード」→「管理」を開き、リリース一覧の「新規作成」をクリックします。
</p><table class="wikitable" border="1"><tbody><tr><td> 入力項目名 </td><td> 入力内容 </td></tr><tr><td> バージョン </td><td> X.Y.Z </td></tr><tr><td> リリースノート </td><td> 今回のリリースの内容を簡潔に 1 行程度で </td></tr><tr><td> 変更履歴 </td><td> <a href="http://sourceforge.jp/projects/simplate/wiki/ChangeLog">ChangeLog</a> の内容コピペで OK </td></tr><tr><td> ファイル </td><td> tarball を指定 </td></tr></tbody></table><p>上記内容で「リリースの作成」ボタンをクリックすればリリース完了です！
</p><h4 id="h4-make.20test">make test</h4><p>Makefile の 126 行目辺りを以下のように変更すると make test が正しく実行できます。
</p><p>変更前
</p><div class="indent">... $(top_srcdir)/run-tests.php -U -d extension_dir=modules/ ...
</div><p>変更後
</p><div class="indent">... $(top_srcdir)/run-tests.php <strong>-n</strong> -U -d extension_dir=modules/ ...
</div><p>これは、make test の際に、extension_dir ディレクティブの値が &quot;modules/&quot; (カレントディレクトリにある modules ディレクトリ) で上書きされるので、php.ini の extension ディレクティブで拡張モジュールを読み込むようにしていると、モジュールが読み込めなかった旨のエラーが出力されてテストが失敗するためです。
</p><p>参考：<a href="http://gihyo.jp/dev/serial/01/php-module/0002?page=2" class="external" rel="nofollow">http://gihyo.jp/dev/serial/01/php-module/0002?page=2</a>
</p><p>php.ini の extension ディレクティブをすべてコメントアウトしても make test が可能ですが、上述のように Makefile を書き換えた方が楽です。
</p><h4 id="h4-.E3.83.87.E3.83.90.E3.83.83.E3.82.B0.E3.83.AD.E3.82.B0">デバッグログ</h4><p>プリコンパイル済みフラグ SIMPLATE_DEBUG を定義するとでバッグログを出力します。デバッグログはカレントディレクトリの debug.log に出力します。デバッグログを出力したい場合は DEBUG_PRINTF マクロを使用することができます。
</p><pre>#define DEBUG_PRINTF(format, ...)
</pre><p>DEBUG_PRINTF は printf 系の format 構文が使用できます。
</p><pre>DEBUG_PRINTF(&quot;variable = (%s)&quot;, variable);
</pre><p>のようにログに出力する文字列を整形してマクロに与えてください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Appendix">V. 付録</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Appendix">
    <title>Appendix</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Appendix</link>
    <dc:identifier>Appendix</dc:identifier>
    <dc:date>2010-01-12T23:44:18+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== V. 付録 ===

==== 目次 ====

 * トラブルシューティング

==== トラブルシューティング ====

執筆中

[[PageNavi(NavigationList)]]]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer">IV. 開発者のための Simplate</a>
</div><div class="next"></div></div>
<h3 id="h3-V..20.E4.BB.98.E9.8C.B2">V. 付録</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li>トラブルシューティング
</li></ul><h4 id="h4-.E3.83.88.E3.83.A9.E3.83.96.E3.83.AB.E3.82.B7.E3.83.A5.E3.83.BC.E3.83.86.E3.82.A3.E3.83.B3.E3.82.B0">トラブルシューティング</h4><p>執筆中
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer">IV. 開発者のための Simplate</a>
</div><div class="next"></div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Advanced">
    <title>Advanced</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Advanced</link>
    <dc:identifier>Advanced</dc:identifier>
    <dc:date>2010-01-12T23:41:14+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 9章 拡張機能 ===

==== 目次 ====

 * [Advanced.prefilter プリフィルタ]
 * [Advanced.postfilter ポストフィルタ]

[[PageNavi(NavigationList)]]]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching.setup">キャッシュのセットアップ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a>
</div></div>
<h3 id="h3-9.E7.AB.A0.20.E6.8B.A1.E5.BC.B5.E6.A9.9F.E8.83.BD">9章 拡張機能</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a>
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching.setup">キャッシュのセットアップ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Caching">
    <title>Caching</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Caching</link>
    <dc:identifier>Caching</dc:identifier>
    <dc:date>2010-01-12T23:40:45+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 8章 キャッシュ ===

==== 目次 ====

 * [Caching.setup キャッシュのセットアップ]

キャッシュは出力内容をファイルに保存する事によって、[Api.functions.display display()] 又は [Api.functions.fetch fetch()] を呼び出]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching.setup">キャッシュのセットアップ</a>
</div></div>
<h3 id="h3-8.E7.AB.A0.20.E3.82.AD.E3.83.A3.E3.83.83.E3.82.B7.E3.83.A5">8章 キャッシュ</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Caching.setup">キャッシュのセットアップ</a>
</li></ul><p>キャッシュは出力内容をファイルに保存する事によって、<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a> 又は <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a> を呼び出す速度を向上させるために使用されます。キャッシュが有効の場合、出力を再生成せずに表示されます。特に処理時間が長いテンプレートは、キャッシュを使用する事で大きく速度が上昇するでしょう。キャッシュされるのは <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a> 又は <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a> の出力結果なので、1 つのキャッシュファイルが複数のテンプレートファイルや 設定ファイル等で構成されていることもあります。
</p><p>テンプレートが動的コンテンツの場合、何をどれくらいの期間キャッシュするのか注意が必要です。例えば、Web サイトの一面にそれほど変更されないコンテンツが表示されている場合は、一時間かそれ以上、このページをキャッシュしても問題なく動作するでしょう。一方、一分経過するごとに新しい情報が格納される天気図をページに表示する場合は、このページをキャッシュする事は意味をなさないでしょう。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching.setup">キャッシュのセットアップ</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.functions">
    <title>Api.functions</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.functions</link>
    <dc:identifier>Api.functions</dc:identifier>
    <dc:date>2010-01-12T23:40:00+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 7章 Simplate クラスメソッド ===

==== 目次 ====

 * [Api.functions.assign assign()] -- テンプレートに値を割り当てます。 
 * [Api.functions.clear_cache clear_cache()] -- 指定したテンプレートのキャッシュ]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">$right_delimiter</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a>
</div></div>
<h3 id="h3-7.E7.AB.A0.20Simplate.20.E3.82.AF.E3.83.A9.E3.82.B9.E3.83.A1.E3.82.BD.E3.83.83.E3.83.89">7章 Simplate クラスメソッド</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a> -- テンプレートに値を割り当てます。 
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a> -- 指定したテンプレートのキャッシュを破棄します。
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a> -- テンプレートを表示します。
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a> -- テンプレートの出力を返します。
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a> -- ポストフィルタを動的に登録します。
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a> -- プリフィルタを動的に登録します。
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">$right_delimiter</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables">
    <title>Api.variables</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables</link>
    <dc:identifier>Api.variables</dc:identifier>
    <dc:date>2010-01-12T23:38:47+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 6章 Simplate クラス変数 ===

==== 目次 ====

 * [Api.variables.template_dir $tempalte_dir]
 * [Api.variables.compile_dir $compile_dir]
 * [Api.variables.compile_check]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$tempalte_dir</a>
</div></div>
<h3 id="h3-6.E7.AB.A0.20Simplate.20.E3.82.AF.E3.83.A9.E3.82.B9.E5.A4.89.E6.95.B0">6章 Simplate クラス変数</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$tempalte_dir</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check">$lazy_check</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">$left_delimiter</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">$right_delimiter</a>
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$tempalte_dir</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">
    <title>Simplate.for.programmer</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer</link>
    <dc:identifier>Simplate.for.programmer</dc:identifier>
    <dc:date>2010-01-12T23:38:29+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== III. プログラマのための Simplate ===

==== 目次 ====

 * [Api.variables 6章 Simplate クラス変数]
 * [Api.functions 7章 クラスメソッド]
 * [Caching 8章 キャッシュ]
 * [Advanced 9章 拡張機能]

]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div></div>
<h3 id="h3-III..20.E3.83.97.E3.83.AD.E3.82.B0.E3.83.A9.E3.83.9E.E3.81.AE.E3.81.9F.E3.82.81.E3.81.AE.20Simplate">III. プログラマのための Simplate</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 クラスメソッド</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">
    <title>Builtin.functions</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Builtin.functions</link>
    <dc:identifier>Builtin.functions</dc:identifier>
    <dc:date>2010-01-12T23:37:11+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 5章 組み込み関数 ===

==== 目次 ====

 * [Builtin.functions.foreach &lt;{foreach}&gt;]
 * [Builtin.functions.if &lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;]
 * [Builtin]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">予約変数 &lt;{$simplate}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a>
</div></div>
<h3 id="h3-5.E7.AB.A0.20.E7.B5.84.E3.81.BF.E8.BE.BC.E3.81.BF.E9.96.A2.E6.95.B0">5章 組み込み関数</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if">&lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">&lt;{include}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal">&lt;{literal}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">&lt;{php}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a>
</li></ul><p>Simplate にはいくつかの組み込み関数があります。
これらはテンプレートエンジンにとって必要不可欠なものです。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">予約変数 &lt;{$simplate}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Variable">
    <title>Variable</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Variable</link>
    <dc:identifier>Variable</dc:identifier>
    <dc:date>2010-01-12T23:36:23+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 4章 変数 ===

==== 目次 ====

 * [Variable.from.php PHP から割り当てられた変数]
 * [Variable.simplate 予約変数 &lt;{$simplate}&gt;]

Simplate は色々な種類の変数を持っています。
変数の種類は接頭辞の記号によって]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php">PHP から割り当てられた変数</a>
</div></div>
<h3 id="h3-4.E7.AB.A0.20.E5.A4.89.E6.95.B0">4章 変数</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php">PHP から割り当てられた変数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">予約変数 &lt;{$simplate}&gt;</a>
</li></ul><p>Simplate は色々な種類の変数を持っています。
変数の種類は接頭辞の記号によって決まります (記号によって囲まれる場合もあります)。
</p><p>Simplate 変数は、その値を直接表示したり <a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a> の引数や <a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a>、条件式の内部などで使用されたりします。
変数の値を表示するには、それを単純に <a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">デリミタ</a> で囲み、デリミタ内に変数のみが含まれるようにします。
</p><h5 id="h5-.E4.BE.8B..20.E5.A4.89.E6.95.B0.E3.81.AE.E4.BE.8B">例. 変数の例</h5><pre>&lt;{$Name}&gt;

&lt;{$product.part_no}&gt; &lt;b&gt;&lt;{$product.description}&gt;&lt;/b&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php">PHP から割り当てられた変数</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">
    <title>Basic.syntax.comment</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment</link>
    <dc:identifier>Basic.syntax.comment</dc:identifier>
    <dc:date>2010-01-12T23:35:43+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== コメント ===

テンプレートのコメントはまずアスタリスクで囲まれ、次にそれを [Api.variables.left_delimiter デリミタ] タグで囲みます。このような形式になります。

{{{
&lt;{* これはコメントです *}&gt;
}}}

Simplate のコメントは、テンプレートの]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">変数</a>
</div></div>
<h3 id="h3-.E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88">コメント</h3><p>テンプレートのコメントはまずアスタリスクで囲まれ、次にそれを <a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">デリミタ</a> タグで囲みます。このような形式になります。
</p><pre>&lt;{* これはコメントです *}&gt;
</pre><p>Simplate のコメントは、テンプレートの最終的な出力には表示されません。
この点は &lt;!-- HTML のコメント --&gt; とは異なります。
これは、テンプレート内での内部的なメモとして使用するのに便利です。
</p><h5 id="h5-.E4.BE.8B..20.E3.83.86.E3.83.B3.E3.83.97.E3.83.AC.E3.83.BC.E3.83.88.E5.86.85.E3.81.AE.E3.82.B3.E3.83.A1.E3.83.B3.E3.83.88">例. テンプレート内のコメント</h5><pre>&lt;{* これは Simplate コメントです。コンパイルされた結果には登場しません。 *}&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;{$title}&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;{**
 * このような複数行に渡るコメントも記述可能です
 *
 * @id
 * @author simplate@gmail.com
*}&gt;
&lt;!-- HTML コメント。これはブラウザに送信されます --&gt;

&lt;{**** &lt;select&gt; ブロック全体をコメント化 *****}&gt;
&lt;{*
&lt;select name=&quot;country&quot;&gt;
  &lt;option value=&quot;jp&quot;&gt;Japan&lt;/option&gt;
&lt;/select&gt;
*}&gt;

&lt;!-- ナビゲーションバーを無効 --&gt;
&lt;{* $navigation *}&gt;

&lt;{* コメントを入れ子にすることはできません *}&gt;
&lt;{*
&lt;select name=&quot;country&quot;&gt;
  &lt;{* &lt;option value=&quot;0&quot;&gt;-- none -- &lt;/option&gt; *}&gt;
  &lt;option value=&quot;jp&quot;&gt;Japan&lt;/option&gt;
&lt;/select&gt;
*}&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">変数</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">
    <title>Basic.syntax</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Basic.syntax</link>
    <dc:identifier>Basic.syntax</dc:identifier>
    <dc:date>2010-01-12T23:34:49+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 3章 基本構文 ===

==== 目次 ====

 * [Basic.syntax.comment コメント]
 * [Basic.syntax.variable 変数]
 * [Basic.syntax.function 関数]
 * [Basic.syntax.attribute 属性]

全てのテン]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">コメント</a>
</div></div>
<h3 id="h3-3.E7.AB.A0.20.E5.9F.BA.E6.9C.AC.E6.A7.8B.E6.96.87">3章 基本構文</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">コメント</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">変数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a>
</li></ul><p>全てのテンプレートタグはデリミタによって囲まれます。 デフォルトではデリミタは &lt;{ と }&gt; ですが、これは <a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">変更可能</a> です。
</p><p>このマニュアルで挙げる例ではデフォルトのデリミタを利用しています。
Simplate では、デリミタ外の内容は静的コンテンツとして表示されます。
Simplate がテンプレ ートタグを見つけると、その解釈を試みて適切な出力に置換します。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">コメント</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">
    <title>Simplate.for.designer</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer</link>
    <dc:identifier>Simplate.for.designer</dc:identifier>
    <dc:date>2010-01-12T23:34:29+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== テンプレートデザイナのための Simplate ===

==== 目次 ====

 * [Basic.syntax 3章 基本構文]
 * [Variable 4章 変数]
 * [Builtin.functions 5章 組み込み関数]

[[PageNavi(NavigationList)]]]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows">Windows でのインストール</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div></div>
<h3 id="h3-.E3.83.86.E3.83.B3.E3.83.97.E3.83.AC.E3.83.BC.E3.83.88.E3.83.87.E3.82.B6.E3.82.A4.E3.83.8A.E3.81.AE.E3.81.9F.E3.82.81.E3.81.AE.20Simplate">テンプレートデザイナのための Simplate</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows">Windows でのインストール</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows">
    <title>Install.for.windows</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Install.for.windows</link>
    <dc:identifier>Install.for.windows</dc:identifier>
    <dc:date>2010-01-12T23:33:58+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== Windows でのインストール ===

==== 動作環境 ====

 * PHP4.3 以上。但し、PHP5 推奨。 (現在は、PHP4 系の開発環境は用意していません)
 * Microsoft Visual C++ 2005 Express Edition 以上。

==== 前提環境のセットアップ ]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div></div>
<h3 id="h3-Windows.20.E3.81.A7.E3.81.AE.E3.82.A4.E3.83.B3.E3.82.B9.E3.83.88.E3.83.BC.E3.83.AB">Windows でのインストール</h3><h4 id="h4-.E5.8B.95.E4.BD.9C.E7.92.B0.E5.A2.83">動作環境</h4><ul><li>PHP4.3 以上。但し、PHP5 推奨。 (現在は、PHP4 系の開発環境は用意していません)
</li><li>Microsoft Visual C++ 2005 Express Edition 以上。
</li></ul><h4 id="h4-.E5.89.8D.E6.8F.90.E7.92.B0.E5.A2.83.E3.81.AE.E3.82.BB.E3.83.83.E3.83.88.E3.82.A2.E3.83.83.E3.83.97">前提環境のセットアップ</h4><h5 id="h5-Apache">Apache</h5><p>Apache をインストールします。<a href="http://httpd.apache.org/download.cgi" class="external" rel="nofollow">Apache のダウンロードページ</a> から最新の Win32 Binary (msi ファイル) をダウンロードし、ウィザードに従ってインストールしてください。デフォルトのインストールで問題ありません。ここでは Apache 2.2.14 を <strong>C:\tools\Apache2.2\</strong> にインストールしました。
</p><h5 id="h5-PHP.20.28Windows.20Binaries.29">PHP (Windows Binaries)</h5><p>PHP の Windows Binaries をインストールします。<a href="http://www.php.net/downloads.php" class="external" rel="nofollow">PHP のダウンロードページ</a> から 5.2.x の最新の installer をダウンロードし、ウィザードに従ってインストールしてください。ここでは PHP 5.2.11 を <strong>C:\php</strong> にインストールしました。
</p><p>Web Server Setup では、インストールした Apache のバージョンに合わせてラジオボタンを選択します。Apache 2.2.14 をインストールしたので <strong>Apache 2.2.x Module</strong> を選択します。
</p><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows/attach/php_install_web_server_setup.jpg"><img src="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows/thumb/default/php_install_web_server_setup.jpg" alt="php_install_web_server_setup.jpg" id="emb-php_install_web_server_setup.jpg-1" title="php_install_web_server_setup.jpg" class="embed-image" width="300" height="236"></a><p>
</p><p>Apache Configuration Directory では、Apache の conf ディレクトリの場所を指定します。Apache の conf ディレクトリは、Apache インストールディレクトリの直下にあります。この場合 <strong>C:\tools\Apache2.2\conf</strong> になります。
</p><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows/attach/php_install_apache_configuration_directory.jpg"><img src="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows/thumb/default/php_install_apache_configuration_directory.jpg" alt="php_install_apache_configuration_directory.jpg" id="emb-php_install_apache_configuration_directory.jpg-1" title="php_install_apache_configuration_directory.jpg" class="embed-image" width="300" height="236"></a><p>
</p><p>Choose Items to Install では、不要なものは極力インストールしない方がハマりません。Simplate を動かすためだけの環境であれば、デフォルトのままで次へ進みましょう。
</p><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows/attach/php_install_choose_items_to_install.jpg"><img src="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows/thumb/default/php_install_choose_items_to_install.jpg" alt="php_install_choose_items_to_install.jpg" id="emb-php_install_choose_items_to_install.jpg-1" title="php_install_choose_items_to_install.jpg" class="embed-image" width="300" height="236"></a><p>
</p><h5 id="h5-httpd.conf.20.E3.81.AE.E7.B7.A8.E9.9B.86">httpd.conf の編集</h5><p>PHP (Windows Binaries) インストール後、httpd.conf (C:\tools\Apache2.2\conf\httpd.conf) は、ファイルの最後に以下のような行が追加されていました。
</p><pre>#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir &quot;C:/tools/PHP/&quot;
LoadModule php5_module &quot;C:/tools/PHP/php5apache2_2.dll&quot;
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
</pre><p>このままの内容で問題はありません。
</p><h5 id="h5-Microsoft.20Visual.20C.2B.2B.202008.20Express.20Edition">Microsoft Visual C++ 2008 Express Edition</h5><p>Microsoft Visual C++ 2008 Express Edition をインストールします。<a href="http://www.microsoft.com/express/vc/" class="external" rel="nofollow">VC のダウンロードページ</a> からダウンロードし、ウィザードに従ってインストールしてください。
</p><h5 id="h5-PHP.20.28Complete.20Source.20Code.29">PHP (Complete Source Code)</h5><p>PHP のソースコードを <a href="http://www.php.net/downloads.php" class="external" rel="nofollow">PHP のダウンロードページ</a> から取得します。取得した tar ball を展開します。ここでは <strong>C:\src\php-5.2.11</strong> に展開しました。
</p><p>これで Simplate をコンパイルする環境が整いました。
</p><h4 id="h4-.E3.82.A4.E3.83.B3.E3.82.B9.E3.83.88.E3.83.BC.E3.83.AB">インストール</h4><p>Simplate のファイルを取得し、ファイルを展開します。以下のようなディレクトリ構成になるよう、展開します。
</p><pre>C:\src\php-5.2.11\
+---Release_TS              &lt;-- 新規作成
|       php5ts.lib          &lt;-- (1)
\---simplate                &lt;-- 新規作成
    \---simplate-X.Y.Z      &lt;-- tar ball 展開
        |   ChangeLog
        |   config.m4
        |   config.w32
        |   CREDITS
        |   EXPERIMENTAL
        |   LICENSE
        |   php_simplate.h
        |   simplate.cpp
        |   simplate.php
        |   simplate.vcproj
        |   
        +---template
        +---tests
</pre><p>ここで (1) に配置するファイルは Binary でインストールした php のインストールディレクトリ配下の dev ディレクトリからコピーしてきます。この場合は <strong>C:\php\dev\php5ts.lib</strong> になります。
</p><p>simplate.vcproj をダブルクリックし、開きます。プロジェクトファイルの変換ウィザードが立ち上がった場合は、ウィザードに従ってプロジェクトファイルを変換します。
</p><p>メニューバーの「ビルド」→「構成マネージャ」をクリックし、「アクティブ ソリューション構成」を「Release」に変更します。
</p><p>メニューバーの「ビルド」→「ソリューションのリビルド」をクリックします。はじめて実行する場合はソリューションファイルの保存先を聞かれますが、そのまま OK で問題ありません。
</p><p>ビルドが正常に完了すると Release フォルダ配下に php_simplate.dll ができあがります。この場合は <strong>C:\src\php-5.2.11\simplate\simplate-X.Y.Z\Release\php_simplate.dll</strong> です。
</p><p>ビルドした php_simplate.dll を extension ディレクトリにコピーします。この場合は <strong>C:\php\ext</strong> です。ext ディレクトリがなければ作成してください。そして、php.ini ファイルに extension の設定をします。<strong>C:\php\php.ini</strong> を開き、以下の行を追加します。
</p><pre>(途中省略)

; Directory in which the loadable extensions (modules) reside.
extension_dir = &quot;C:\tools\php\ext\&quot;

(途中省略)

[PHP_SIMPLATE]
extension=php_simplate.dll
</pre><p>これで Apache を再起動すれば完了です。
</p><h4 id="h4-.E5.8B.95.E4.BD.9C.E7.A2.BA.E8.AA.8D">動作確認</h4><pre>&lt;?php
phpinfo();
?&gt;
</pre><p>上記内容のファイルを <strong>C:\tools\Apache2.2\htdocs\phpinfo.php</strong> として保存し、ブラウザから <a href="http://localhost/phpinfo.php" class="external" rel="nofollow">http://localhost/phpinfo.php</a> にアクセスし、以下のような情報が出力されていれば OK です。
</p><table class="wikitable" border="1"><tbody><tr><td>simplate support</td><td>enalbed</td></tr><tr><td>Version</td><td>X.Y.Z</td></tr></tbody></table><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Features">
    <title>Features</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Features</link>
    <dc:identifier>Features</dc:identifier>
    <dc:date>2010-01-12T23:30:55+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 1章 Simplate とは？ ===

Simplate は、PHP のためのテンプレートエンジンです。PHP のロジックとコンテンツを分離して管理するのを容易にします。これにより、プログラマとデザイナの役割が分けられている場合に作業がしやすくなります。

==== Simplate の特徴 ====

 * 非]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Started">I. はじめに</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Started">I. はじめに</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
</div></div>
<h3 id="h3-1.E7.AB.A0.20Simplate.20.E3.81.A8.E3.81.AF.EF.BC.9F">1章 Simplate とは？</h3><p>Simplate は、PHP のためのテンプレートエンジンです。PHP のロジックとコンテンツを分離して管理するのを容易にします。これにより、プログラマとデザイナの役割が分けられている場合に作業がしやすくなります。
</p><h4 id="h4-Simplate.20.E3.81.AE.E7.89.B9.E5.BE.B4">Simplate の特徴</h4><ul><li>非常に高速 (Smarty テンプレートエンジンよりも遥かに高速)
</li><li>Smarty の機能の一部が使用可能。
</li><li>テンプレートのコンパイルは 1 度だけ行われるので、テンプレートの構文解析のオーバーヘッドが少ない。
</li><li>デリミタタグの記法を変更可能 (default:&lt;{$variable}&gt;)
</li><li>if, section, foreach 構文のサポート
</li><li>テンプレート内でコメントが使える
</li><li>php タグにより、PHP の構文そのものも使用可能です。 (但し、テンプレートにロジックを埋め込みやすくなるため、非推奨)
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Started">I. はじめに</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Started">I. はじめに</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Started">
    <title>Started</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Started</link>
    <dc:identifier>Started</dc:identifier>
    <dc:date>2010-01-12T22:41:15+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== I. はじめに ===

==== 目次 ====

 * [Features 1章 Simplate とは？]
 * [Install 2章 インストール]

[[PageNavi(NavigationList)]]]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Features">1章 Simplate とは？</a>
</div></div>
<h3 id="h3-I..20.E3.81.AF.E3.81.98.E3.82.81.E3.81.AB">I. はじめに</h3><h4 id="h4-.E7.9B.AE.E6.AC.A1">目次</h4><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Features">1章 Simplate とは？</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Features">1章 Simplate とは？</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">
    <title>Advanced.postfilter</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter</link>
    <dc:identifier>Advanced.postfilter</dc:identifier>
    <dc:date>2009-11-23T22:55:39+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== ポストフィルタ ===

ポストフィルタは、テンプレートが &#039;&#039;コンパイルされた後に&#039;&#039; 実行される PHP ユーザ定義関数です。ポストフィルタを使用するには、[Api.functions.register_postfilter 登録] が必要となります。

Simplate は]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer">IV. 開発者のための Simplate</a>
</div></div>
<h3 id="h3-.E3.83.9D.E3.82.B9.E3.83.88.E3.83.95.E3.82.A3.E3.83.AB.E3.82.BF">ポストフィルタ</h3><p>ポストフィルタは、テンプレートが <em>コンパイルされた後に</em> 実行される PHP ユーザ定義関数です。ポストフィルタを使用するには、<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">登録</a> が必要となります。
</p><p>Simplate は内部でユーザ定義関数の第 1 パラメータにコンパイルされたテンプレートのソースコードを渡すので、関数内で処理を行った後にその結果のソースコードを戻り値として返すようにします。
</p><h5 id="h5-.E4.BE.8B..20.E3.83.9D.E3.82.B9.E3.83.88.E3.83.95.E3.82.A3.E3.83.AB.E3.82.BF.E3.82.92.E4.BD.BF.E7.94.A8.E3.81.99.E3.82.8B">例. ポストフィルタを使用する</h5><pre>&lt;?php
// このユーザ定義関数をアプリケーションに加えます
function add_header_comment($tpl_source)
{
    return &quot;&lt;?php echo \&quot;&lt;!-- Created by Smarty! --&gt;\n\&quot;; ?&gt;\n&quot; . $tpl_source;
}

// ポストフィルタを登録します
$simplate-&gt;register_postfilter('add_header_comment');
$simplate-&gt;display('index.tpl');
?&gt;
</pre><p>上のポストフィルタは、このようなコンパイル済みテンプレート index.tpl を作成します。
</p><pre>&lt;!-- Created by Smarty! --&gt;
&lt;{* 以下、残りのコンテンツ *}&gt;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a> および <a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer">IV. 開発者のための Simplate</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">
    <title>Advanced.prefilter</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter</link>
    <dc:identifier>Advanced.prefilter</dc:identifier>
    <dc:date>2009-11-23T22:51:27+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== プリフィルタ ===

プリフィルタは、テンプレートが &#039;&#039;コンパイルされる前に&#039;&#039; 実行される PHP ユーザ定義関数です。テンプレートに含まれた不必要なコメントを除いたり、第三者にテンプレートの更新を任せている時にテンプレート内にどのようなものが含まれているかを監視する等といった]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a>
</div></div>
<h3 id="h3-.E3.83.97.E3.83.AA.E3.83.95.E3.82.A3.E3.83.AB.E3.82.BF">プリフィルタ</h3><p>プリフィルタは、テンプレートが <em>コンパイルされる前に</em> 実行される PHP ユーザ定義関数です。テンプレートに含まれた不必要なコメントを除いたり、第三者にテンプレートの更新を任せている時にテンプレート内にどのようなものが含まれているかを監視する等といった前処理を行います。
</p><p>プリフィルタを使用するには、<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">登録</a> が必要となります。
</p><p>Simplate は内部でユーザ定義関数の第 1 パラメータにテンプレートのソースコードを渡すので、関数内で処理を行った後にその結果のソースコードを戻り値として返すようにします。
</p><h5 id="h5-.E4.BE.8B..20.E3.83.97.E3.83.AA.E3.83.95.E3.82.A3.E3.83.AB.E3.82.BF.E3.82.92.E4.BD.BF.E7.94.A8.E3.81.99.E3.82.8B">例. プリフィルタを使用する</h5><p>これはテンプレートソース内の全てのコメントを取り除いてくれるでしょう。
</p><pre>&lt;?php
// このユーザ定義関数をアプリケーションに加えます
function remove_dw_comments($tpl_source)
{
    return preg_replace(&quot;/&lt;!--#.*--&gt;/U&quot;, '', $tpl_source);
}

// プリフィルタを登録します
$simplate-&gt;register_prefilter('remove_dw_comments');
$simplate-&gt;display('index.tpl');
?&gt;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a> および <a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/NavigationList">
    <title>NavigationList</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/NavigationList</link>
    <dc:identifier>NavigationList</dc:identifier>
    <dc:date>2009-11-23T22:45:53+09:00</dc:date>
        <description>
      <![CDATA[ * [NavigationList Simplate マニュアル]
   * [Started I. はじめに]
     * [Features 1章 Simplate とは？]
     * [Install 2章 インストール]
       * [Install.for.windows Windows でのインストール]
   * [Simplate.for.designer ]]>
    </description>
    <content:encoded>
      <![CDATA[<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/NavigationList">Simplate マニュアル</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Started">I. はじめに</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Features">1章 Simplate とは？</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Install">2章 インストール</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Install.for.windows">Windows でのインストール</a>
</li></ul></li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.designer">II. テンプレートデザイナのための Simplate</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">コメント</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">変数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a>
</li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php">PHP から割り当てられた変数</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">予約変数 &lt;{$simplate}&gt;</a>
</li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if">&lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">&lt;{include}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal">&lt;{literal}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">&lt;{php}&gt;</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a>
</li></ul></li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$tempalte_dir</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check">$lazy_check</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">$left_delimiter</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">$right_delimiter</a>
</li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a>
</li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Caching.setup">キャッシュのセットアップ</a>
</li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
<ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a>
</li></ul></li></ul></li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Simpalte.for.developer">IV. 開発者のための Simplate</a>
</li><li><a href="http://sourceforge.jp/projects/simplate/wiki/Appendix">V. 付録</a>
</li></ul></li></ul>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Caching.setup">
    <title>Caching.setup</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Caching.setup</link>
    <dc:identifier>Caching.setup</dc:identifier>
    <dc:date>2009-11-23T22:38:43+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== キャッシュのセットアップ ===

まずはじめにキャッシュを有効にします。これは、&#039;&#039;[Api.variables.caching $caching]&#039;&#039; = 1 (あるいは 2) を設定するだけです。

===== 例. キャッシュを有効にする =====

{{{ cod]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div></div>
<h3 id="h3-.E3.82.AD.E3.83.A3.E3.83.83.E3.82.B7.E3.83.A5.E3.81.AE.E3.82.BB.E3.83.83.E3.83.88.E3.82.A2.E3.83.83.E3.83.97">キャッシュのセットアップ</h3><p>まずはじめにキャッシュを有効にします。これは、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a></em> = 1 (あるいは 2) を設定するだけです。
</p><h5 id="h5-.E4.BE.8B..20.E3.82.AD.E3.83.A3.E3.83.83.E3.82.B7.E3.83.A5.E3.82.92.E6.9C.89.E5.8A.B9.E3.81.AB.E3.81.99.E3.82.8B">例. キャッシュを有効にする</h5><pre>&lt;?php
$simplate = new Simplate();
$simplate-&gt;caching = 1;
$simplate-&gt;display('index.tpl');
?&gt;
</pre><p>いつものようにテンプレートから出力内容をパースするために display('index.tpl') を呼び出しますが、キャッシュを有効にした事でその出力内容をコピーしたファイルが <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a></em> 内に保存されます。次回 display('index.tpl') が呼ばれる際には、再びテンプレートをパースする代わりにキャッシュされたコピーが使用されます。
</p><h5 id="h5-.E3.83.86.E3.82.AF.E3.83.8B.E3.82.AB.E3.83.AB.E3.83.8E.E3.83.BC.E3.83.88">テクニカルノート</h5><ul><li><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a></em> 内のファイルにはテンプレート名に類似した名前が付けられます。PHPスクリプトとして実行されません。これらのファイルは編集しないで下さい！
</li></ul><p>各々のキャッシュされたページは、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a></em> 生存時間が限られています。デフォルト値は 3600 秒です。期限が過ぎた後、キャッシュは再生成されます。<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a></em> = 2 を設定する事によって、個々のキャッシュに自分自身の生存時間を与える事が可能です。詳細は、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a></em> を参照して下さい
</p><h5 id="h5-.E4.BE.8B..20.E3.82.AD.E3.83.A3.E3.83.83.E3.82.B7.E3.83.A5.E3.81.94.E3.81.A8.E3.81.AB.E7.94.9F.E5.AD.98.E6.99.82.E9.96.93.E3.82.92.E8.A8.AD.E5.AE.9A.E3.81.99.E3.82.8B">例. キャッシュごとに生存時間を設定する</h5><pre>&lt;?php
$simplate = new Simplate();
$simplate-&gt;caching = 2; // 生存時間はキャッシュごと

// index.tpl に 5 分の cache_lifetime をセットします
$simplate-&gt;cache_lifetime = 300;
$simplate-&gt;display('index.tpl');

// home.tpl に 1 時間の cache_lifetime をセットします
$simplate-&gt;cache_lifetime = 3600;
$simplate-&gt;display('home.tpl');

// 注: $caching = 2 の時、次のような $cache_lifetime の設定は動作しません。
// home.tpl のキャッシュの生存時間は既に 1 時間にセットされているので、
// もはや、$cache_lifetime の値が尊重される事はありません。
// home.tpl のキャッシュは、今までどおり 1 時間後に満期になるでしょう。
$simplate-&gt;cache_lifetime = 30; // 30 seconds
$simplate-&gt;display('home.tpl');
?&gt;
</pre><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a></em> が有効の時、キャッシュファイルに入り組んだすべてのテンプレートファイルと設定ファイルは 修正されたかどうかをチェックされます。もしキャッシュが生成されてからいくつかのファイルが修正されていた場合、キャッシュは即座に再生成されます。これは最適なパフォーマンスのためには僅かなオーバーヘッドになるので、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a></em> は FALSE にして下さい。
</p><h5 id="h5-.E4.BE.8B..20.24compile_check.20.E3.82.92.E6.9C.89.E5.8A.B9.E3.81.AB.E3.81.99.E3.82.8B">例. $compile_check を有効にする</h5><pre>&lt;?php
$simplate = new Simplate();
$simplate-&gt;caching = 1;
$simplate-&gt;compile_check = true;
$simplate-&gt;display('index.tpl');
?&gt;
</pre><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a></em> が有効の場合、キャッシュファイルは常に再生成されます。これは事実上、キャッシュ機能を無効にします。通常、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a> は [ デバッグ] 目的でのみ使用し、キャッシュは </em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a><em> = 0 にセットして無効にするのがさらに効率の良い方法です。
</em></p><p><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a> 関数によって、個々のキャッシュファイルをクリアする事ができます。
</p><h5 id="h5-.E4.BE.8B..20.E3.82.AD.E3.83.A3.E3.83.83.E3.82.B7.E3.83.A5.E3.82.92.E3.82.AF.E3.83.AA.E3.82.A2.E3.81.99.E3.82.8B">例. キャッシュをクリアする</h5><pre>&lt;?php
$simplate = new Simplate();
$simplate-&gt;caching = 1;

// index.tpl のキャッシュファイルをクリアします
$simplate-&gt;clear_cache('index.tpl');

$simplate-&gt;display('index.tpl');
?&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Advanced">9章 拡張機能</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">
    <title>Api.functions.display</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.functions.display</link>
    <dc:identifier>Api.functions.display</dc:identifier>
    <dc:date>2009-11-23T22:20:02+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== display() ===

display() -- テンプレートを表示します。

==== 説明 ====

void &#039;&#039;&#039;display&#039;&#039;&#039; (string template)

テンプレートを表示します ([Api.functions.fe]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a>
</div></div>
<h3 id="h3-display.28.29">display()</h3><p>display() -- テンプレートを表示します。
</p><h4 id="h4-.E8.AA.AC.E6.98.8E">説明</h4><p>void <strong>display</strong> (string template)
</p><p>テンプレートを表示します (<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a> と違い出力を行います)。第１パラメータには、テンプレートを指定します。
</p><h5 id="h5-.E4.BE.8B..20display.28.29">例. display()</h5><pre>&lt;?php
$simplate = new Smarty();
$simplate-&gt;caching = true;

$address = '245 N 50th';
$db_data = array(
               'City' =&gt; 'Tokyo',
               'State' =&gt; 'Japan',
               'Zip' =&gt; '100000'
             );
$simplate-&gt;assign('Name', 'Yamada');
$simplate-&gt;assign('Address', $address);
$simplate-&gt;assign('data', $db_data);

// 出力を表示します
$smarty-&gt;display('index.tpl');
?&gt;
</pre><h5 id="h5-.E4.BE.8B..20display.28.29.20.E9.96.A2.E6.95.B0.E3.81.AB.E3.83.95.E3.83.AB.E3.83.91.E3.82.B9.E3.82.92.E6.8C.87.E5.AE.9A.E3.81.97.E3.81.9F.E4.BE.8B">例. display() 関数にフルパスを指定した例</h5><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$template_dir</a></em> ディレクトリ外のファイルを表示するためには、フルパスを指定します。
</p><pre>&lt;?php
// ファイルの絶対パス
$simplate-&gt;display('/usr/local/include/template/header.tpl');

// windows環境の絶対パス
$simplate-&gt;display('C:/www/pub/template/header.tpl');
?&gt;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">
    <title>Builtin.functions.include</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include</link>
    <dc:identifier>Builtin.functions.include</dc:identifier>
    <dc:date>2009-11-23T22:19:52+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== &lt;{include}&gt; ===

&lt;{include}&gt; タグを使用して、現在のテンプレートに他のテンプレートをインクルードします。現在のテンプレートにて利用可能なあらゆる変数は、インクルードされたテンプレートでも同じく利用可能です。

 * &lt;{include}&gt; タグには、テンプ]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if">&lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal">&lt;{literal}&gt;</a>
</div></div>
<h3 id="h3-.3C.7Binclude.7D.3E">&lt;{include}&gt;</h3><p>&lt;{include}&gt; タグを使用して、現在のテンプレートに他のテンプレートをインクルードします。現在のテンプレートにて利用可能なあらゆる変数は、インクルードされたテンプレートでも同じく利用可能です。
</p><ul><li>&lt;{include}&gt; タグには、テンプレートリソースのパスを含んだ file 属性を必ず指定する必要があります。
</li><li>file 属性に / から始まるパスを指定した場合はフルパスとして扱います。
</li><li>file 属性が / から始まらない場合は相対パスとして扱います。基点となるディレクトリは <a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">template_dir</a> で指定したディレクトリです。
</li><li>全ての割り当て変数の値は、インクルードされたテンプレート内で使用可能です。また、インクルードされたテンプレート内での変数の変更も &lt;{include}&gt; の後でインクルードしている側のテンプレート内で参照可能です。
</li></ul><table class="wikitable" border="1"><tbody><tr><td>属性名	</td><td>型		</td><td>必須	</td><td>デフォルト	</td><td>概要</td></tr><tr><td>file	</td><td>string	</td><td>Yes	</td><td>n/a		</td><td>インクルードするテンプレートファイル名</td></tr></tbody></table><h5 id="h5-.E4.BE.8B..20.E3.82.B7.E3.83.B3.E3.83.97.E3.83.AB.E3.81.AA.20.3C.7Binclude.7D.3E.20.E3.81.AE.E4.BE.8B">例. シンプルな &lt;{include}&gt; の例</h5><pre>&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;&lt;{$title}&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;{include file='page_header.tpl'}&gt;

&lt;{* ここにテンプレートの本体を記述します。変数 $tpl_name
   はたとえば 'contact.tpl' などに置き換えられます。
*}&gt;
&lt;{include file=&quot;$tpl_name.tpl&quot;}&gt;

&lt;{include file='page_footer.tpl'}&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre><h5 id="h5-.E4.BE.8B..20.E3.81.95.E3.81.BE.E3.81.96.E3.81.BE.E3.81.AA.20.3C.7Binclude.7D.3E.20.E3.83.AA.E3.82.BD.E3.83.BC.E3.82.B9.E3.81.AE.E4.BE.8B">例. さまざまな &lt;{include}&gt; リソースの例</h5><pre>&lt;{* ファイルの絶対パス *}&gt;
&lt;{include file='/usr/local/include/template/header.tpl'}&gt;

&lt;{* windows環境の絶対パス *}&gt;
&lt;{include file='C:/www/pub/template/header.tpl'}&gt;

&lt;{* 変数名に格納された名前のテンプレートをインクルード - 例 $module = 'contacts' *}&gt;
&lt;{include file=&quot;$module.tpl&quot;}&gt;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">&lt;{php}&gt;</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if">&lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal">&lt;{literal}&gt;</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">
    <title>Api.functions.fetch</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch</link>
    <dc:identifier>Api.functions.fetch</dc:identifier>
    <dc:date>2009-11-23T22:17:30+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== fetch() ===

fetch() -- テンプレートの出力を返します。

==== 説明 ====

string &#039;&#039;&#039;fetch&#039;&#039;&#039; (string template)

これは、テンプレートを [Api.functions.displa]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a>
</div></div>
<h3 id="h3-fetch.28.29">fetch()</h3><p>fetch() -- テンプレートの出力を返します。
</p><h4 id="h4-.E8.AA.AC.E6.98.8E">説明</h4><p>string <strong>fetch</strong> (string template)
</p><p>これは、テンプレートを <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">表示する</a> のではなくその出力を返します。第１パラメータには、テンプレートを指定します。
</p><h5 id="h5-.E4.BE.8B..20fetch.28.29">例. fetch()</h5><pre>&lt;?php
$simplate = new Simplate();
$simplate-&gt;caching = true;

$address = '245 N 50th';
$db_data = array(
               'City' =&gt; 'Tokyo',
               'State' =&gt; 'Japan',
               'Zip' =&gt; '1000000'
             );
$simplate-&gt;assign('Name', 'Yamada');
$simplate-&gt;assign('Address', $address);
$simplate-&gt;assign('db_data', $db_data);

// 出力を取り込みます
$output = $simplate-&gt;fetch('index.tpl');

// ここで$outputについて何かの処理を行います
echo $output;
?&gt;
</pre><h5 id="h5-.E4.BE.8B..20Email.20.E3.81.AE.E9.80.81.E4.BF.A1.E3.81.AB.20fetch.28.29.20.E3.82.92.E4.BD.BF.E7.94.A8.E3.81.99.E3.82.8B">例. Email の送信に fetch() を使用する</h5><p>email_body.tpl テンプレート
</p><pre>Dear &lt;{$contact.name}&gt;,

Welcome and thankyou for signing up as a member of our user group,

Click on the link below to login with your user name of '&lt;{$contact.login_id}&gt;'
so you can post in our forums.

http://simplate.example.com/login/

List master
Some user group
</pre><p>PHP の <a href="http://php.net/function.mail" class="external" rel="nofollow">mail()</a> 関数を用いたPHPスクリプト
</p><pre>&lt;?php

// pear や adodb などを使用して、データベースから連絡先を取得します
$query = 'select name, email, login_id from contacts where contact_id=' . $contact_id;
$contact = $db-&gt;getRow($sql);
$simplate-&gt;assign('contact', $contact);

mail($contact['email'], 'Subject', $simplate-&gt;fetch('email_body.tpl'));

?&gt;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">
    <title>Api.functions.register_prefillter</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter</link>
    <dc:identifier>Api.functions.register_prefillter</dc:identifier>
    <dc:date>2009-11-23T22:08:27+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== register_prefillter() ===

register_prefilter() -- プリフィルタを動的に登録します。

==== 説明 ====

void &#039;&#039;&#039;register_prefilter&#039;&#039;&#039; (mixed function]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
</div></div>
<h3 id="h3-register_prefillter.28.29">register_prefillter()</h3><p>register_prefilter() -- プリフィルタを動的に登録します。
</p><h4 id="h4-.E8.AA.AC.E6.98.8E">説明</h4><p>void <strong>register_prefilter</strong> (mixed function)
</p><p>テンプレートをコンパイルする前に実行する、<a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a> を動的に登録します。プリフィルタ関数の定義の仕方は、<a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.prefilter">プリフィルタ</a> の項を参照して下さい。
</p><p>PHP 関数のコールバック <em>function</em> は、次のいずれかとなります。
</p><ul><li>関数名を含んだ文字列
</li></ul><p><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">register_postfilter()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">8章 キャッシュ</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter">
    <title>Api.functions.register_postfilter</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_postfilter</link>
    <dc:identifier>Api.functions.register_postfilter</dc:identifier>
    <dc:date>2009-11-23T22:08:11+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== register_postfillter() ===

register_postfilter() -- ポストフィルタを動的に登録します。

==== 説明 ====

void &#039;&#039;&#039;register_postfilter&#039;&#039;&#039; (mixed func]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a>
</div></div>
<h3 id="h3-register_postfillter.28.29">register_postfillter()</h3><p>register_postfilter() -- ポストフィルタを動的に登録します。
</p><h4 id="h4-.E8.AA.AC.E6.98.8E">説明</h4><p>void <strong>register_postfilter</strong> (mixed function)
</p><p>テンプレートをコンパイルした後で実行される <a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a> を動的に登録します。ポストフィルタ関数の定義の仕方は、<a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.postfilter">ポストフィルタ</a> の項を参照して下さい。
</p><p>PHP 関数のコールバック <em>function</em> は、次のいずれかとなります。
</p><ul><li>関数名を含んだ文字列
</li></ul><p><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.register_prefillter">register_prefilter()</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">
    <title>Api.functions.clear_cache</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache</link>
    <dc:identifier>Api.functions.clear_cache</dc:identifier>
    <dc:date>2009-11-23T21:13:02+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== clear_cache() ===

clear_cache() -- 指定したテンプレートのキャッシュを破棄します。

==== 説明 ====

void &#039;&#039;&#039;clear_cache&#039;&#039;&#039; (string template)

指定したテンプレー]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a>
</div></div>
<h3 id="h3-clear_cache.28.29">clear_cache()</h3><p>clear_cache() -- 指定したテンプレートのキャッシュを破棄します。
</p><h4 id="h4-.E8.AA.AC.E6.98.8E">説明</h4><p>void <strong>clear_cache</strong> (string template)
</p><p>指定したテンプレートのキャッシュを破棄します。
</p><h5 id="h5-.E4.BE.8B..20clear_cache.28.29">例. clear_cache()</h5><pre>&lt;?php
// キャッシュファイルの削除
$simplate-&gt;clear_cache('index.tpl');
?&gt;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Caching">キャッシュの項</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">
    <title>Api.functions.assign</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign</link>
    <dc:identifier>Api.functions.assign</dc:identifier>
    <dc:date>2009-11-23T21:08:34+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== assign() ===

assign() -- テンプレートに値を割り当てます。

==== 説明 ====

void &#039;&#039;&#039;assign&#039;&#039;&#039; (string varname, mixed var)

テンプレート変数名/値のペアを明示的に指定]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a>
</div></div>
<h3 id="h3-assign.28.29">assign()</h3><p>assign() -- テンプレートに値を割り当てます。
</p><h4 id="h4-.E8.AA.AC.E6.98.8E">説明</h4><p>void <strong>assign</strong> (string varname, mixed var)
</p><p>テンプレート変数名/値のペアを明示的に指定するか、それらが格納された連想配列を指定します。
</p><h5 id="h5-.E4.BE.8B..20assign.28.29">例. assign()</h5><pre>&lt;?php
// 名前/値のペアを渡します
$simplate-&gt;assign('Name', 'Yamada');
$simplate-&gt;assign('Address', $address);

// 連想配列を渡します
$simplate-&gt;assign(array('city' =&gt; 'Tokyo', 'state' =&gt; 'Japan'));

// 配列を渡します
$myArray = array('no' =&gt; 10, 'label' =&gt; 'Peanuts');
$simplate-&gt;assign('foo', $myArray);
?&gt;
</pre><p>テンプレートの内容
</p><pre>&lt;{* 変数は、php と同様に大文字小文字を区別することに注意しましょう *}&gt;
&lt;{$Name}&gt;
&lt;{$Address}&gt;
&lt;{$city}&gt;
&lt;{$state}&gt;

&lt;{$foo.no}, &lt;{$foo.label}&gt;
</pre><p>より複雑な配列の割り当てに関しては、<a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a> および <a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a> を参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">
    <title>Api.variables.right_delimiter</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter</link>
    <dc:identifier>Api.variables.right_delimiter</dc:identifier>
    <dc:date>2009-11-23T20:53:31+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $right_delimiter ===

これは、テンプレート言語の終端を表すデリミタです。デフォルトは }&gt; です。

&#039;&#039;[Api.variables.left_delimiter $left_delimiter]&#039;&#039; も参照してください。

[[PageNavi]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">$left_delimiter</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div></div>
<h3 id="h3-.24right_delimiter">$right_delimiter</h3><p>これは、テンプレート言語の終端を表すデリミタです。デフォルトは }&gt; です。
</p><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">$left_delimiter</a></em> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">$left_delimiter</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions">7章 Simplate クラスメソッド</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">
    <title>Api.variables.left_delimiter</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter</link>
    <dc:identifier>Api.variables.left_delimiter</dc:identifier>
    <dc:date>2009-11-23T20:52:23+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $left_delimiter ===

これは、テンプレート言語の開始を表すデリミタです。デフォルトは &lt;{ です。

&#039;&#039;[Api.variables.right_delimiter $right_delimiter]&#039;&#039; も参照してください。

[[PageNav]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">$right_delimiter</a>
</div></div>
<h3 id="h3-.24left_delimiter">$left_delimiter</h3><p>これは、テンプレート言語の開始を表すデリミタです。デフォルトは &lt;{ です。
</p><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">$right_delimiter</a></em> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.right_delimiter">$right_delimiter</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">
    <title>Api.variables.cache_lifetime</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime</link>
    <dc:identifier>Api.variables.cache_lifetime</dc:identifier>
    <dc:date>2009-11-23T20:50:23+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $cache_lifetime ===

テンプレートのキャッシュの期限 (単位：秒) です。これが切れるとキャッシュは再生成されます。

 * &#039;&#039;$cache_lifetime&#039;&#039; を使用するためには、&#039;&#039;[Api.variables.caching $c]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">$left_delimiter</a>
</div></div>
<h3 id="h3-.24cache_lifetime">$cache_lifetime</h3><p>テンプレートのキャッシュの期限 (単位：秒) です。これが切れるとキャッシュは再生成されます。
</p><ul><li><em>$cache_lifetime</em> を使用するためには、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a> を有効に (1 あるいは 2 のいずれかに) する必要があります。
</em></li><li>この値を -1 にすると、キャッシュを無期限で有効とします。
</li><li>この値を 0 にすると、キャッシュを常に再生成します (これはテスト時にのみ有用です。キャッシュを無効にするためには、より効率的な方法として <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a></em> = 0 があります)。
</li><li>各テンプレートごとに有効期限を独自に設定したい場合は <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a></em> = 2 とします。そして <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.display">display()</a> あるいは <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">fetch()</a> を呼び出す前に <em>$cache_lifetime</em> に値を設定してください。
</li></ul><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a></em> が有効の場合、キャッシュファイルは毎回再生成されるので事実上キャッシュは無効になります。<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.clear_cache">clear_cache()</a> 関数で特定のキャッシュファイルをクリアする事が出来ます。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.left_delimiter">$left_delimiter</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">
    <title>Api.variables.compile_check</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check</link>
    <dc:identifier>Api.variables.compile_check</dc:identifier>
    <dc:date>2009-11-23T20:40:32+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $compile_check ===

Simplate は PHP アプリケーションの各リクエスト時に、現在のテンプレートが最後に訪れた時から変更されている (タイムスタンプが異なる) かどうかを検査します。もし変更されているならば、そのテンプレートを再コンパイルします。そのテンプレートが一度もコンパイルされていなかった]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check">$lazy_check</a>
</div></div>
<h3 id="h3-.24compile_check">$compile_check</h3><p>Simplate は PHP アプリケーションの各リクエスト時に、現在のテンプレートが最後に訪れた時から変更されている (タイムスタンプが異なる) かどうかを検査します。もし変更されているならば、そのテンプレートを再コンパイルします。そのテンプレートが一度もコンパイルされていなかった場合は、この設定に関係なくコンパイルを行います。この変数のデフォルトは TRUE です。
</p><p>テンプレートが変更される予定がないアプリケーションがいったん稼動に入れば、もはや compile_check のステップは必要ありません。最大限のパフォーマンスを向上させるために、必ず $compile_check を FALSE に設定して下さい。<span id="_fn_ref-1" class="footnote-ref"><a href="#_fn_note-1">*1</a></span> また、この設定を FALSE に変更した後にテンプレートファイルが変更された場合、そのテンプレートが再コンパイルされる事は「ない」ので変更は反映されない事に注意してください。<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a></em> と <em>$compile_check</em> が共に有効ならば、テンプレートファイルが更新されるとキャッシュファイルが再生成されます。詳細は <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a></em> を参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check">$lazy_check</a>
</div></div><hr><ol id="footnote" class="footnote"><li id="_fn_note-1"><a class="footnote-revref footnote-counter" href="#_fn_ref-1">*1</a>ただし、筆者の経験上、コンパイルチェックに要する時間は非常に短いため、稼働後のテンプレート変更時の手順を複雑にするぐらいなら、TRUE のままで運用して問題ないと考えます。</li></ol>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">
    <title>Api.variables.force_compile</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile</link>
    <dc:identifier>Api.variables.force_compile</dc:identifier>
    <dc:date>2009-11-23T20:40:08+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $force_compile ===

テンプレートが呼び出される毎に強制的にコンパイル (再コンパイル) を行います。この設定は、&#039;&#039;[Api.variables.compile_check $compile_check]&#039;&#039; をオーバーライドします。デフォルトの設定では FALS]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check">$lazy_check</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a>
</div></div>
<h3 id="h3-.24force_compile">$force_compile</h3><p>テンプレートが呼び出される毎に強制的にコンパイル (再コンパイル) を行います。この設定は、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a></em> をオーバーライドします。デフォルトの設定では FALSE (無効) になっています。開発や デバッグ の際に便利ですが、決して運用環境で使用してはいけません。<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a></em> が有効の場合はキャッシュファイルは毎回再生成されます。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check">$lazy_check</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">
    <title>Api.variables.caching</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching</link>
    <dc:identifier>Api.variables.caching</dc:identifier>
    <dc:date>2009-11-23T20:38:28+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $caching ===

テンプレートの出力を &#039;&#039;[Api.variables.cache_dir $cache_dir]&#039;&#039; にキャッシュするかどうかを設定します。デフォルトは 0 で、これは無効を意味します。テンプレートが何度も同じコンテンツを生成するような場合は、&#039]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a>
</div></div>
<h3 id="h3-.24caching">$caching</h3><p>テンプレートの出力を <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a></em> にキャッシュするかどうかを設定します。デフォルトは 0 で、これは無効を意味します。テンプレートが何度も同じコンテンツを生成するような場合は、<em>$caching</em> を有効にするほうがよいでしょう。これにより、パフォーマンスが向上します。
</p><ul><li>値として 1 または 2 を指定すると、キャッシュを有効にします。
</li><li>1 は、Simplate にそのキャッシュが期限切れかどうかを調べるために、現在の時間と <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a></em> の値を比較するように指示します。
</li><li>2 は、Simplate にそのキャッシュが生成された時点の時間と <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a></em> の値を比較するように指示します。このようにキャッシュの期限を制御するために、テンプレートを <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.fetch">取得</a> する直前に <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a></em> をセットする事ができます。<strong>未検証</strong>
</li><li><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a></em> が有効な場合、キャッシュに含まれるテンプレートが変更されていると、キャッシュを再生成します。
</li><li><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a></em> が有効ならば常にキャッシュを再生成します。
</li></ul><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a></em>、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a></em> および <a href="http://sourceforge.jp/projects/simplate/wiki/Caching">キャッシュの項</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">$cache_dir</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir">
    <title>Api.variables.cache_dir</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_dir</link>
    <dc:identifier>Api.variables.cache_dir</dc:identifier>
    <dc:date>2009-11-23T20:37:43+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $cache_dir ===

テンプレートのキャッシュが格納されるディレクトリです。デフォルトは cache で、これは実行中の PHP スクリプトが置かれた場所にある cache/ ディレクトリを探す事を意味します。このディレクトリは Web サーバが書き込み可能でなくてはなりません。 詳細は [Install インス]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a>
</div></div>
<h3 id="h3-.24cache_dir">$cache_dir</h3><p>テンプレートのキャッシュが格納されるディレクトリです。デフォルトは cache で、これは実行中の PHP スクリプトが置かれた場所にある cache/ ディレクトリを探す事を意味します。このディレクトリは Web サーバが書き込み可能でなくてはなりません。 詳細は <a href="http://sourceforge.jp/projects/simplate/wiki/Install">インストールについての説明</a> を参照してください。
</p><h5 id="h5-.E3.83.86.E3.82.AF.E3.83.8B.E3.82.AB.E3.83.AB.E3.83.8E.E3.83.BC.E3.83.88">テクニカルノート</h5><ul><li>この設定は、相対パス又は絶対パスである必要があります。include_path はファイル書き込み時には使用されません。
</li><li>このディレクトリを Web サーバのドキュメントルート下に置く事は推奨しません。
</li></ul><p><em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a></em>、<em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a></em> および <a href="http://sourceforge.jp/projects/simplate/wiki/Caching">キャッシュの項</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.caching">$caching</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.cache_lifetime">$cache_lifetime</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check">
    <title>Api.variables.lazy_check</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.lazy_check</link>
    <dc:identifier>Api.variables.lazy_check</dc:identifier>
    <dc:date>2009-11-23T20:23:21+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $lazy_check ===

$lazy_check を TRUE に設定すると include しているファイルのコンパイルチェックを行いません。デフォルトの設定では FALSE (無効) になっています。$lazy_check は &#039;&#039;[Api.variables.compile_check $]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a>
</div></div>
<h3 id="h3-.24lazy_check">$lazy_check</h3><p>$lazy_check を TRUE に設定すると include しているファイルのコンパイルチェックを行いません。デフォルトの設定では FALSE (無効) になっています。$lazy_check は <em><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a></em> が TRUE の場合のみ有効です。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.force_compile">$force_compile</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php">
    <title>Variable.from.php</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Variable.from.php</link>
    <dc:identifier>Variable.from.php</dc:identifier>
    <dc:date>2009-11-23T19:43:04+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== PHP から割り当てられた変数 ===
PHP から [Api.functions.assign 割り当てられた] 変数は、 (php と同様に) 先頭にドル記号 ($) をつける事で参照できます。

===== 例. 割り当てられた変数 =====

php script

{{{ code
&lt;?php]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">予約変数 &lt;{$simplate}&gt;</a>
</div></div>
<h3 id="h3-PHP.20.E3.81.8B.E3.82.89.E5.89.B2.E3.82.8A.E5.BD.93.E3.81.A6.E3.82.89.E3.82.8C.E3.81.9F.E5.A4.89.E6.95.B0">PHP から割り当てられた変数</h3><p>PHP から <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">割り当てられた</a> 変数は、 (php と同様に) 先頭にドル記号 ($) をつける事で参照できます。
</p><h5 id="h5-.E4.BE.8B..20.E5.89.B2.E3.82.8A.E5.BD.93.E3.81.A6.E3.82.89.E3.82.8C.E3.81.9F.E5.A4.89.E6.95.B0">例. 割り当てられた変数</h5><p>php script
</p><pre>&lt;?php

$simplate = new Simplate();

$simplate-&gt;assign('firstname', 'Doug');
$simplate-&gt;assign('lastname', 'Evans');
$simplate-&gt;assign('meetingPlace', 'New York');

$simplate-&gt;display('index.tpl');

?&gt;
</pre><p>一方、index.tpl の内容はこのようになります。
</p><pre>Hello &lt;{$firstname}&gt; &lt;{$lastname}&gt;, glad to see you can make it.
&lt;br /&gt;
&lt;{* これは動作しません。変数名は大文字小文字を区別するからです。 *}&gt;
This weeks meeting is in &lt;{$meetingplace}&gt;.
&lt;{* こちらは動作します *}&gt;
This weeks meeting is in &lt;{$meetingPlace}&gt;.
</pre><p>出力は次のようになります。
</p><pre>Hello Doug Evans, glad to see you can make it.
&lt;br /&gt;
This weeks meeting is in .
This weeks meeting is in New York.
</pre><h4 id="h4-.E9.80.A3.E6.83.B3.E9.85.8D.E5.88.97">連想配列</h4><p>PHP から割り当てられた連想配列を参照することもできます。
この場合は、'.' (ピリオド) 記号の後にキーを指定します。
</p><h5 id="h5-.E4.BE.8B..20.E9.80.A3.E6.83.B3.E9.85.8D.E5.88.97.E3.81.AE.E5.80.A4.E3.81.AB.E3.82.A2.E3.82.AF.E3.82.BB.E3.82.B9.E3.81.99.E3.82.8B">例. 連想配列の値にアクセスする</h5><pre>&lt;?php
$simplate-&gt;assign('Contacts',
    array('fax' =&gt; '555-222-9876',
          'email' =&gt; 'simplate@simplate.example.com',
          'phone' =&gt; array('home' =&gt; '555-444-3333',
                           'cell' =&gt; '555-111-1234')
                           )
         );
$simplate-&gt;display('index.tpl');
?&gt;
</pre><p>一方、index.tpl の内容はこのようになります。
</p><pre>&lt;{$Contacts.fax}&gt;&lt;br /&gt;
&lt;{$Contacts.email}&gt;&lt;br /&gt;
&lt;{* you can print arrays of arrays as well *}&gt;
&lt;{$Contacts.phone.home}&gt;&lt;br /&gt;
&lt;{$Contacts.phone.cell}&gt;&lt;br /&gt;
</pre><p>出力は次のようになります。
</p><pre>555-222-9876&lt;br /&gt;
simplate@simplate.example.com&lt;br /&gt;
555-444-3333&lt;br /&gt;
555-111-1234&lt;br /&gt;
</pre><h4 id="h4-.E9.85.8D.E5.88.97.E3.81.AE.E3.82.A4.E3.83.B3.E3.83.87.E3.83.83.E3.82.AF.E3.82.B9">配列のインデックス</h4><p>配列に対してインデックスでアクセスすることもできます。
</p><h5 id="h5-.E4.BE.8B..20.E3.82.A4.E3.83.B3.E3.83.87.E3.83.83.E3.82.AF.E3.82.B9.E3.81.AB.E3.82.88.E3.81.A3.E3.81.A6.E9.85.8D.E5.88.97.E3.81.AB.E3.82.A2.E3.82.AF.E3.82.BB.E3.82.B9.E3.81.99.E3.82.8B">例. インデックスによって配列にアクセスする</h5><pre>&lt;?php
$simplate-&gt;assign('Contacts', array(
                           '555-222-9876',
                           'simplate@simplate.example.com',
                            array('555-444-3333',
                                  '555-111-1234')
                            ));
$simplate-&gt;display('index.tpl');
?&gt;
</pre><p>一方、index.tpl の内容はこのようになります。
</p><pre>&lt;{$Contacts.0}&gt;&lt;br /&gt;
&lt;{$Contacts.1}&gt;&lt;br /&gt;
&lt;{* you can print arrays of arrays as well *}&gt;
&lt;{$Contacts.2.0}&gt;&lt;br /&gt;
&lt;{$Contacts.2.1}&gt;&lt;br /&gt;
</pre><p>出力は次のようになります。
</p><pre>555-222-9876&lt;br /&gt;
simplate@simplate.example.com&lt;br /&gt;
555-444-3333&lt;br /&gt;
555-111-1234&lt;br /&gt;
</pre><h4 id="h4-.E3.82.AA.E3.83.96.E3.82.B8.E3.82.A7.E3.82.AF.E3.83.88">オブジェクト</h4><p>PHP から割り当てられた <a href="http://sourceforge.jp/projects/simplate/wiki/Advanced.object">オブジェクト</a> のプロパティにアクセスするには、-&gt; 記号の後にプロパティ名を指定します。
</p><h5 id="h5-.E4.BE.8B..20.E3.82.AA.E3.83.96.E3.82.B8.E3.82.A7.E3.82.AF.E3.83.88.E3.81.AE.E3.83.97.E3.83.AD.E3.83.91.E3.83.86.E3.82.A3.E3.81.AB.E3.82.A2.E3.82.AF.E3.82.BB.E3.82.B9.E3.81.99.E3.82.8B">例. オブジェクトのプロパティにアクセスする</h5><pre>name:  &lt;{$person-&gt;name}&gt;&lt;br /&gt;
email: &lt;{$person-&gt;email}&gt;&lt;br /&gt;
</pre><p>出力は次のようになります。
</p><pre>name:  Simplate simplate&lt;br /&gt;
email: simplate@simplate.example.com&lt;br /&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">予約変数 &lt;{$simplate}&gt;</a>
</div></div>
]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">
    <title>Variable.simplate</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Variable.simplate</link>
    <dc:identifier>Variable.simplate</dc:identifier>
    <dc:date>2009-11-23T19:42:21+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 予約変数  &lt;{$simplate}&gt; ===

PHP の予約変数 &lt;{$simplate}&gt; を使用すると、Simplate が予め用意している変数にアクセスすることができます。
Smarty では環境変数やリクエスト変数にアクセスすることができますが、Simplate が用意している予約変数]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php">PHP から割り当てられた変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div></div>
<h3 id="h3-.E4.BA.88.E7.B4.84.E5.A4.89.E6.95.B0.20.20.3C.7B.24simplate.7D.3E">予約変数  &lt;{$simplate}&gt;</h3><p>PHP の予約変数 &lt;{$simplate}&gt; を使用すると、Simplate が予め用意している変数にアクセスすることができます。
Smarty では環境変数やリクエスト変数にアクセスすることができますが、Simplate が用意している予約変数の機能はわずかです。
これは、処理を高速化するために機能を必要最小限にしているためです。
</p><h4 id="h4-.3C.7B.24simplate.section.7D.3E">&lt;{$simplate.section}&gt;</h4><p>&lt;{$simplate.section}&gt; 変数は、<a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a> のループプロパティを参照するために使用します。
この中には .first、.index といった有用な値が含まれます。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.from.php">PHP から割り当てられた変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">
    <title>Api.variables.template_dir</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir</link>
    <dc:identifier>Api.variables.template_dir</dc:identifier>
    <dc:date>2009-11-23T19:40:32+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $template_dir ===

これは、デフォルトのテンプレートディレクトリの名前です。ファイルのインクルード時に相対パスを指定した場合は、このディレクトリから探します。デフォルトは template で、これは、実行しているスクリプトと同じ場所にある template/ ディレクトリを探すということです。

=]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a>
</div></div>
<h3 id="h3-.24template_dir">$template_dir</h3><p>これは、デフォルトのテンプレートディレクトリの名前です。ファイルのインクルード時に相対パスを指定した場合は、このディレクトリから探します。デフォルトは template で、これは、実行しているスクリプトと同じ場所にある template/ ディレクトリを探すということです。
</p><h5 id="h5-.E3.83.86.E3.82.AF.E3.83.8B.E3.82.AB.E3.83.AB.E3.83.8E.E3.83.BC.E3.83.88">テクニカルノート</h5><ul><li>このディレクトリを Web サーバのドキュメントルート下に置く事を推奨しません。
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">$compile_dir</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir">
    <title>Api.variables.compile_dir</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_dir</link>
    <dc:identifier>Api.variables.compile_dir</dc:identifier>
    <dc:date>2009-11-23T19:39:39+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== $compile_dir ===

コンパイルされたテンプレートが置かれるディレクトリです。デフォルトは template_c で、これは実行中の PHP スクリプトが置かれた場所にある template_c/ ディレクトリを探すことを意味します。&#039;&#039;&#039;このディレクトリは Web サーバが書き]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$tempalte_dir</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a>
</div></div>
<h3 id="h3-.24compile_dir">$compile_dir</h3><p>コンパイルされたテンプレートが置かれるディレクトリです。デフォルトは template_c で、これは実行中の PHP スクリプトが置かれた場所にある template_c/ ディレクトリを探すことを意味します。<strong>このディレクトリは Web サーバが書き込み可能でなければなりません。</strong> 詳細は <a href="http://sourceforge.jp/projects/simplate/wiki/Install">インストール</a> の説明を参照してください。
</p><h5 id="h5-.E3.83.86.E3.82.AF.E3.83.8B.E3.82.AB.E3.83.AB.E3.83.8E.E3.83.BC.E3.83.88">テクニカルノート</h5><ul><li>この設定は相対パス又は絶対パスである必要があります。include_path はファイル書き込み時には使用されません。
</li><li>このディレクトリを Web サーバのドキュメントルート下に置く事は推奨されません。
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables">6章 Simplate クラス変数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.template_dir">$tempalte_dir</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Api.variables.compile_check">$compile_check</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">
    <title>Builtin.functions.section</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section</link>
    <dc:identifier>Builtin.functions.section</dc:identifier>
    <dc:date>2009-11-23T18:33:24+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== &lt;{section}&gt; === 

&lt;{section}&gt; は、&#039;&#039;&#039;データの配列&#039;&#039;&#039; をループするために使用します。これは、[Builtin.functions.foreach &lt;{foreach}&gt;] が &#039;&#]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">&lt;{php}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div></div>
<h3 id="h3-.3C.7Bsection.7D.3E">&lt;{section}&gt;</h3><p>&lt;{section}&gt; は、<strong>データの配列</strong> をループするために使用します。これは、<a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a> が <strong>1 つの連想配列</strong> をループするのとは異な
ります。すべての &lt;{section}&gt; タグは、終了タグ &lt;{/section}&gt; とペアになっている必要があります。
</p><table class="wikitable" border="1"><tbody><tr><td>属性名    </td><td>型        </td><td>必須  </td><td>デフォルト    </td><td>概要</td></tr><tr><td>name      </td><td>string    </td><td>Yes   </td><td>n/a           </td><td>セクション名</td></tr><tr><td>loop      </td><td>mixed     </td><td>Yes   </td><td>n/a           </td><td>ループ回数を決定する値</td></tr><tr><td>start     </td><td>integer   </td><td>No    </td><td>0             </td><td>ループを開始するインデックス位置。<strong>負の値は指定できません。</strong>ループ配列の長さを超えるような無効な値は、自動的に最も近い値に切り捨てられます。</td></tr><tr><td>step      </td><td>integer   </td><td>No    </td><td>1             </td><td>ループインデックスを進めるために使われるステップ値。例えば step=2 なら、インデックスは 0, 2, 4 をループします。<strong>負の値は指定できません。</strong></td></tr></tbody></table><ul><li>必須の属性は <em>name</em> と <em>loop</em> です。
</li><li>&lt;{section}&gt; の <em>name</em> は、英数字とアンダースコアを使って自由に命名できます。これは <a href="http://php.net/language.variables" class="external" rel="nofollow">PHP の変数</a> と同様です。
</li><li>&lt;{section}&gt; はネスト可能で、その場合の &lt;{section}&gt; の名前はお互いにユニークである必要があります。
</li><li><em>loop</em> 属性で指定されたループ変数 (たいていは配列) は、&lt;{section}&gt; のループ回数を決定するために使用されます。
</li><li>&lt;{section}&gt; 内で値を表示するには、変数名に続けてブラケット &lt;{}&gt; で囲んだセクション名を指定します。
</li><li>&lt;{section}&gt; には、そのプロパティを操作するための自身の変数があります。これらには <em><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">&lt;{$simplate.section.name.property}&gt;</a></em> としてアクセスできます。
</li><li>&lt;{section}&gt; のプロパティには、<em>index</em>、<em>first</em>、<em>last</em> があります。
</li></ul><p>PHP や C、Java などの言語の for ループに慣れている方には、馴染みにくい構文ですが、name 属性はループ変数の変数名と考えると理解の一助になるかもしれません。実際コンパイル後のテンプレートファイルを読むと、section は for 文に展開し、name 属性に指定したループ変数でループしていることに気づくと思います。
</p><h5 id="h5-.E4.BE.8B..20.3C.7Bsection.7D.3E.20.E3.81.A7.E3.81.AE.E3.82.B7.E3.83.B3.E3.83.97.E3.83.AB.E3.81.AA.E9.85.8D.E5.88.97.E3.81.AE.E3.83.AB.E3.83.BC.E3.83.97">例. &lt;{section}&gt; でのシンプルな配列のループ</h5><p>配列を Simplate に <a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a> します。
</p><pre>&lt;?php
$data = array(1000, 1001, 1002);
$simplate-&gt;assign('custid', $data);
?&gt;
</pre><p>配列を出力するテンプレート
</p><pre>&lt;{* この例は $custid 配列のすべての値を表示します *}&gt; 
&lt;{section name=customer loop=$custid}&gt;
  id: &lt;{$custid[customer]}&gt;&lt;br /&gt;
&lt;{/section}&gt;
</pre><p>上の例の出力
</p><pre>id: 1000&lt;br /&gt;
id: 1001&lt;br /&gt;
id: 1002&lt;br /&gt;
</pre><h5 id="h5-.E4.BE.8B..20.3C.7Bsection.7D.3E.20.E3.81.AE.E5.90.8D.E5.89.8D">例. &lt;{section}&gt; の名前</h5><p>&lt;{section}&gt; の <em>name</em> は自由につけることができます。<a href="http://php.net/language.variables" class="external" rel="nofollow">PHP の変数</a> を参照してください。これは、&lt;{section}&gt; 内のデータを参照する際
に使用します。
</p><pre>&lt;{section name=anything loop=$myArray}&gt;
  &lt;{$myArray[anything].foo}&gt;
  &lt;{$name[anything]}&gt;
  &lt;{$address[anything].bar}&gt;
&lt;{/section}&gt;
</pre><h5 id="h5-.E4.BE.8B..20.3C.7Bsection.7D.3E.20.E3.81.A7.E3.81.AE.E9.80.A3.E6.83.B3.E9.85.8D.E5.88.97.E3.81.AE.E3.83.AB.E3.83.BC.E3.83.97">例. &lt;{section}&gt; での連想配列のループ</h5><p>これは、データの連想配列を &lt;{section}&gt; で出力する例です。次に示すのは、配列 <em>$contacts</em> を Simplate に渡す PHP スクリプトです。
</p><pre>&lt;?php
$data = array(
          array('name' =&gt; 'Taro Yamada', 'home' =&gt; '555-555-5555',
                'cell' =&gt; '666-555-5555', 'email' =&gt; 'yamada@simplate.com'),
          array('name' =&gt; 'Hanako Tanaka', 'home' =&gt; '777-555-5555',
                'cell' =&gt; '888-555-5555', 'email' =&gt; 'tanaka@simplate.com'),
          array('name' =&gt; 'Ichiro Suzuki', 'home' =&gt; '000-555-5555',
                'cell' =&gt; '123456', 'email' =&gt; 'suzuki@simplate.com')
        );
$simplate-&gt;assign('contacts',$data);
?&gt;
</pre><p><em>$contacts</em> を出力するテンプレート
</p><pre>&lt;{section name=customer loop=$contacts}&gt;
&lt;p&gt;
  name: &lt;{$contacts[customer].name}&gt;&lt;br /&gt;
  home: &lt;{$contacts[customer].home}&gt;&lt;br /&gt;
  cell: &lt;{$contacts[customer].cell}&gt;&lt;br /&gt;
  e-mail: &lt;{$contacts[customer].email}&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;{/section}&gt;
</pre><p>上の例の出力
</p><pre>&lt;p&gt;
  name: Taro Yamada&lt;br /&gt;
  home: 555-555-5555&lt;br /&gt;
  cell: 666-555-5555&lt;br /&gt;
  e-mail: yamada@simplate.com&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
  name: Hanako Tanaka&lt;br /&gt;
  home: 777-555-5555&lt;br /&gt;
  cell: 888-555-5555&lt;br /&gt;
  e-mail: tanaka@simplate.com&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
  name: Ichiro Suzuki&lt;br /&gt;
  home: 000-555-5555&lt;br /&gt;
  cell: 123456&lt;br /&gt;
  e-mail: suzuki@simplate.com&lt;br /&gt;
&lt;/p&gt;
</pre><h5 id="h5-.E4.BE.8B..20.3C.7Bsection.7D.3E.20.E3.81.A7.E3.81.AE.20loop.20.E5.A4.89.E6.95.B0.E3.81.AE.E4.BD.BF.E7.94.A8">例. &lt;{section}&gt; での loop 変数の使用</h5><p>この例では、<em>$custid</em>、<em>$name</em> および <em>$address</em> にはすべて配列が割り当てられ、その要素数は同じであるものとします。まず、Simplate に配列を割り当てる PHP スクリプトです。
</p><pre>&lt;?php
$id = array(1000, 1001, 1002);
$fullnames = array('Taro Yamada', 'Hanako Tanaka', 'Ichiro Suzuki');
$addr = array('253 Abbey road', '417 Mulberry ln', '5605 apple st');

$simplate-&gt;assign('custid', $id);
$simplate-&gt;assign('name', $fullnames);
$simplate-&gt;assign('address', $addr);
?&gt;
</pre><p><em>loop</em> 変数は、ループの回数を決定するためにのみ使用します。&lt;{section}&gt; 内ではあらゆるテンプレート変数にアクセス可能です。
</p><pre>&lt;{section name=customer loop=$custid}&gt;
&lt;p&gt;
  id: &lt;{$custid[customer]}&gt;&lt;br /&gt;
  name: &lt;{$name[customer]}&gt;&lt;br /&gt;
  address: &lt;{$address[customer]}&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;{/section}&gt;
</pre><p>上の例の出力
</p><pre>&lt;p&gt;
  id: 1000&lt;br /&gt;
  name: Taro Yamada&lt;br /&gt;
  address: 253 Abbey road&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
  id: 1001&lt;br /&gt;
  name: Hanako Tanaka&lt;br /&gt;
  address: 417 Mulberry ln&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
  id: 1002&lt;br /&gt;
  name: Ichiro Suzuki&lt;br /&gt;
  address: 5605 apple st&lt;br /&gt;
&lt;/p&gt;
</pre><h5 id="h5-.E4.BE.8B..20.E3.83.8D.E3.82.B9.E3.83.88.E3.81.97.E3.81.9F.20.3C.7Bsection.7D.3E">例. ネストした &lt;{section}&gt;</h5><p>&lt;{section}&gt; は無制限にネスト可能です。&lt;{section}&gt; をネストすることで、 多次元配列のような複雑なデータ構造にアクセスすることが可能です。これは、配列を割り当てる PHP スクリプトの例です。
</p><pre>&lt;?php

$id = array(1001, 1002, 1003);
$simplate-&gt;assign('custid', $id);

$fullnames = array('Taro Yamada', 'Hanako Tanaka', 'Ichiro Suzuki');
$simplate-&gt;assign('name', $fullnames);

$addr = array('253 Abbey road', '417 Mulberyy ln', '5605 apple st');
$simplate-&gt;assign('address', $addr);

$types = array(
           array('home phone', 'cell phone', 'e-mail'),
           array('home phone', 'web'),
           array('cell phone')
         );
$simplate-&gt;assign('contact_type', $types);

$info = array(
           array('555-555-5555', '666-555-5555', 'yamada@simplate.com'),
           array('123-456-4', 'www.simplate.com'),
           array('0457878')
        );
$simplate-&gt;assign('contact_info', $info);

?&gt;
</pre><p>このテンプレートでは、<em>$contact_type[customer]</em> は現在の顧客の連絡手段を格納した配列となります。
</p><pre>&lt;{section name=customer loop=$custid}&gt;
&lt;hr&gt;
  id: &lt;{$custid[customer]}&gt;&lt;br /&gt;
  name: &lt;{$name[customer]}&gt;&lt;br /&gt;
  address: &lt;{$address[customer]}&gt;&lt;br /&gt;
&lt;{section name=contact loop=$contact_type[customer]}&gt;
    &lt;{$contact_type[customer][contact]}&gt;: &lt;{$contact_info[customer][contact]}&gt;&lt;br /&gt;
&lt;{/section}&gt;
&lt;{/section}&gt;
</pre><p>上の例の出力。
</p><pre>&lt;hr&gt;
  id: 1000&lt;br /&gt;
  name: Taro Yamada&lt;br /&gt;
  address: 253 Abbey road&lt;br /&gt;
    home phone: 555-555-5555&lt;br /&gt;
    cell phone: 666-555-5555&lt;br /&gt;
    e-mail: yamada@simplate.com&lt;br /&gt;
&lt;hr&gt;
  id: 1001&lt;br /&gt;
  name: Hanako Tanaka&lt;br /&gt;
  address: 417 Mulberry ln&lt;br /&gt;
    home phone: 123-456-4&lt;br /&gt;
    web: www.simplate.com&lt;br /&gt;
&lt;hr&gt;
  id: 1002&lt;br /&gt;
  name: Ichiro Suzuki&lt;br /&gt;
  address: 5605 apple st&lt;br /&gt;
    cell phone: 0457878&lt;br /&gt;
</pre><h4 id="h4-.index">.index</h4><p><em>index</em> は現在のループインデックスを表示します。0 (又は start 属性の値) から始まり、1 (又は step 属性の値) ずつ増加します。
</p><h5 id="h5-.E4.BE.8B..20.3C.7Bsection.7D.3E.20.E3.81.AE.20index.20.E3.83.97.E3.83.AD.E3.83.91.E3.83.86.E3.82.A3">例. &lt;{section}&gt; の index プロパティ</h5><p>ちなみに $custid[customer.index] と $custid[customer] は同じ意味です。
</p><pre>&lt;{section name=customer loop=$custid}&gt;
  &lt;{$simplate.section.customer.index}&gt; id: &lt;{$custid[customer]}&gt;&lt;br /&gt;
&lt;{/section}&gt;
</pre><p>上の例の出力
</p><pre>0 id: 1000&lt;br /&gt;
1 id: 1001&lt;br /&gt;
2 id: 1002&lt;br /&gt;
</pre><h4 id="h4-.first">.first</h4><p><em>first</em> は、現在 &lt;{section}&gt; の一回目の処理を行っている場合に TRUE となります。
</p><h4 id="h4-.last">.last</h4><p><em>last</em> は、現在 &lt;{section}&gt; の最後の処理を行っている場合に TRUE となります。
</p><h5 id="h5-.E4.BE.8B..20.3C.7Bsection.7D.3E.20.E3.83.97.E3.83.AD.E3.83.91.E3.83.86.E3.82.A3.20first.20.E3.81.A8.20last">例. &lt;{section}&gt; プロパティ first と last</h5><p>この例は $customers 配列をループし、ループの最初でヘッダブロック、そしてループの最後でフッタブロックを出力します。
</p><pre>&lt;{section name=customer loop=$contacts}&gt;
&lt;{if $simplate.section.customer.first}&gt;
&lt;table&gt;
&lt;tr&gt;&lt;th&gt;id&lt;/th&gt;&lt;th&gt;customer&lt;/th&gt;&lt;/tr&gt;
&lt;{/if}&gt;
&lt;tr&gt;
  &lt;td&gt;&lt;{$customers[customer].name}&gt;&lt;/td&gt;
  &lt;td&gt;&lt;{$customers[customer].email}&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;{if $simplate.section.customer.last}&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;{$simplate.section.contacts.count}&gt; customers&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;{/if}&gt;
&lt;{/section}&gt;
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a> も参照してください。
</p><h3 id="h3-Smarty.20.E3.81.A8.E3.81.AE.E5.B7.AE.E5.88.86">Smarty との差分</h3><ul><li>loop 属性に整数を指定することはできません。このため、配列を割り当てない section を実現することはできません。
</li><li>start 属性に負の値を指定することはできません。
</li><li>step 属性に負の値を指定することはできません。
</li><li>max, show 属性はサポートしていません。
</li><li>index_prev, index_next, iteration, rownum, loop, show, total プロパティはサポートしていません。
</li></ul><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">&lt;{php}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Simplate.for.programmer">III. プログラマのための Simplate</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php">
    <title>Builtin.functions.php</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.php</link>
    <dc:identifier>Builtin.functions.php</dc:identifier>
    <dc:date>2009-11-23T14:02:44+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== &lt;{php}&gt; ===

&lt;{php}&gt; タグで、PHP コードを直接テンプレートに埋め込むことができます。これはエスケープされません。このタグは上級ユーザのためのものなので通常は必要とされません。

===== 例. &lt;{php}&gt; タグ内での PHP コード =====

{]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal">&lt;{literal}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a>
</div></div>
<h3 id="h3-.3C.7Bphp.7D.3E">&lt;{php}&gt;</h3><p>&lt;{php}&gt; タグで、PHP コードを直接テンプレートに埋め込むことができます。これはエスケープされません。このタグは上級ユーザのためのものなので通常は必要とされません。
</p><h5 id="h5-.E4.BE.8B..20.3C.7Bphp.7D.3E.20.E3.82.BF.E3.82.B0.E5.86.85.E3.81.A7.E3.81.AE.20PHP.20.E3.82.B3.E3.83.BC.E3.83.89">例. &lt;{php}&gt; タグ内での PHP コード</h5><pre>&lt;{php}&gt;
   // PHP スクリプトをテンプレートから直接インクルードします
   include('/path/to/display_weather.php');
&lt;{/php}&gt;
</pre><h5 id="h5-.E4.BE.8B..20.3C.7Bphp.7D.3E.20.E3.82.BF.E3.82.B0.E3.81.A7.20global.20.E3.82.92.E4.BD.BF.E7.94.A8.E3.81.97.E3.81.A6.E5.A4.89.E6.95.B0.E3.82.92.E4.BB.A3.E5.85.A5.E3.81.99.E3.82.8B">例. &lt;{php}&gt; タグで global を使用して変数を代入する</h5><pre>&lt;{* このテンプレートは {php} ブロックを含み、その中で変数 $varX を割り当てます *}&gt;
&lt;{php}&gt;
   global $foo, $bar;
   if ($foo == $bar) {
     echo 'This will be sent to browser';
   }
  // 変数を Smarty に割り当てます
  $this-&gt;assign('varX', 'Toffee');
&lt;{/php}&gt;
&lt;{* 変数を出力します *}&gt;
&lt;strong&gt;&lt;{$varX}&gt;&lt;/strong&gt; is my fav ice cream :-)
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">&lt;{include}&gt;</a> も参照してください。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.literal">&lt;{literal}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if">
    <title>Builtin.functions.if</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if</link>
    <dc:identifier>Builtin.functions.if</dc:identifier>
    <dc:date>2009-11-23T13:57:17+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== &lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt; ===

Simplate における &lt;{if}&gt; ステートメントは、PHP の [http://php.net/if if] と同等の柔軟性を持っています。全ての &lt;{if}&gt; は、対応する &lt;{/if}&]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">&lt;{include}&gt;</a>
</div></div>
<h3 id="h3-.3C.7Bif.7D.3E.3C.7Belseif.7D.3E.3C.7Belse.7D.3E">&lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;</h3><p>Simplate における &lt;{if}&gt; ステートメントは、PHP の <a href="http://php.net/if" class="external" rel="nofollow">if</a> と同等の柔軟性を持っています。全ての &lt;{if}&gt; は、対応する &lt;{/if}&gt; とペアである必要があります。&lt;{else}&gt; と &lt;{elseif}&gt; も使用できます。<em>||</em> や <em>or</em>、<em>&amp;&amp;</em>、<em>and</em>、<em>is_array()</em> など、PHP の条件演算子や関数はすべて利用可能です。
</p><p>以下は認識される条件演算子の一覧です。これらはスペースによって周りの要素から分離される必要があります。[] 内に記載された項目は任意である事に注意して下さい。&quot;PHP 相当&quot; には、PHP において当てはまるものが示されます。
</p><table class="wikitable" border="1"><tbody><tr><td>条件演算子 </td><td>代替       </td><td>構文例	        </td><td>意味	        </td><td>PHP 相当</td></tr><tr><td>==              </td><td>eq	        </td><td>$a eq $b	</td><td>等しい	        </td><td>==</td></tr><tr><td>!=               </td><td>ne, neq  </td><td>$a neq $b	</td><td>等しくない	</td><td>!=</td></tr><tr><td>&gt;                </td><td>gt            </td><td>$a gt $b	</td><td>より大きい	</td><td>&gt;</td></tr><tr><td>&lt;                </td><td>lt             </td><td>$a lt $b	</td><td>より小さい	</td><td>&lt;</td></tr><tr><td>&gt;=             </td><td>gte, ge   </td><td>$a ge $b	</td><td>以上	        </td><td>&gt;=</td></tr><tr><td>&lt;=             </td><td>lte, le     </td><td>$a le $b	</td><td>以下	        </td><td>&lt;=</td></tr><tr><td>===          </td><td>               </td><td>$a === 0	</td><td>同一性のチェック	</td><td>===</td></tr><tr><td>!                  </td><td>not         </td><td>not $a	        </td><td>否定 (単項)	</td><td>!</td></tr><tr><td>%                </td><td>mod       </td><td>$a mod $b	</td><td>剰余	        </td><td>%</td></tr></tbody></table><h5 id="h5-.E4.BE.8B..20.3C.7Bif.7D.3E.20.E3.82.B9.E3.83.86.E3.83.BC.E3.83.88.E3.83.A1.E3.83.B3.E3.83.88">例. &lt;{if}&gt; ステートメント</h5><pre>&lt;{if $name eq 'Fred'}&gt;
    Welcome Sir.
&lt;{elseif $name eq 'Wilma'}&gt;
    Welcome Ma'am.
&lt;{else}&gt;
    Welcome, whatever you are.
&lt;{/if}&gt;

&lt;{* 論理演算子 &quot;or&quot; の例 *}&gt;
&lt;{if $name eq 'Fred' or $name eq 'Wilma'}&gt;
   ...
&lt;{/if}&gt;

&lt;{* 上と同じ *}&gt;
&lt;{if $name == 'Fred' || $name == 'Wilma'}&gt;
   ...
&lt;{/if}&gt;

&lt;{* 括弧は使用可能 *}&gt;
&lt;{if ($amount &lt; 0 or $amount &gt; 1000) and $volume &gt;= 100}&gt;
   ...
&lt;{/if}&gt;

&lt;{* PHP 関数を埋め込むことも可能 *}&gt;
&lt;{if count($var) gt 0}&gt;
   ...
&lt;{/if}&gt;

&lt;{* 配列のチェック *}&gt;
&lt;{if is_array($foo) }&gt;
   .....
&lt;{/if}&gt;

&lt;{* null でないことのチェック *}&gt;
&lt;{if isset($foo) }&gt;
   .....
&lt;{/if}&gt;
</pre><h5 id="h5-.E4.BE.8B..20.3C.7Bif.7D.3E.20.E3.81.AE.E3.81.9D.E3.81.AE.E4.BB.96.E3.81.AE.E4.BE.8B">例. &lt;{if}&gt; のその他の例</h5><pre>&lt;{if isset($name) &amp;&amp; $name == 'Blog'}&gt;
     &lt;{* 何かを行います *}&gt;
&lt;{elseif $name == $foo}&gt;
    &lt;{* 何かを行います *}&gt;
&lt;{/if}&gt;

&lt;{if is_array($foo) &amp;&amp; count($foo) &gt; 0) }&gt;
    &lt;{* foreach ループを実行します *}&gt;
&lt;{/if}&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">&lt;{foreach}&gt;</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.include">&lt;{include}&gt;</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach">
    <title>Builtin.functions.foreach</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.foreach</link>
    <dc:identifier>Builtin.functions.foreach</dc:identifier>
    <dc:date>2009-11-15T22:34:58+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== &lt;{foreach}&gt; ===

&lt;{foreach}&gt; を使用して、通常の数値添字配列と同じように &#039;&#039;&#039;連想配列&#039;&#039;&#039; をループします。
[Builtin.functions.section &lt;{section}&gt;] のよ]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if">&lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;</a>
</div></div>
<h3 id="h3-.3C.7Bforeach.7D.3E">&lt;{foreach}&gt;</h3><p>&lt;{foreach}&gt; を使用して、通常の数値添字配列と同じように <strong>連想配列</strong> をループします。
<a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a> のように、<strong>数値添字の配列のみ</strong> をループさせるということはありません。
&lt;{foreach}&gt; の構文は <a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.section">&lt;{section}&gt;</a> よりずっと簡単ですが、その代わりに <strong>1 つの配列</strong> しか扱えません。
すべての &lt;{foreach}&gt; タグは、終了タグ &lt;{/foreach}&gt; とペアである必要があります。
</p><table class="wikitable" border="1"><tbody><tr><td>属性名	</td><td>型	        </td><td>必須	</td><td>デフォルト	</td><td>概要</td></tr><tr><td>from	</td><td>array	</td><td>Yes	</td><td>n/a	        </td><td>ループに使用する配列</td></tr><tr><td>item	</td><td>string	</td><td>Yes	</td><td>n/a	        </td><td>現在の要素を示す変数の名前</td></tr><tr><td>key	</td><td>string	</td><td>No	</td><td>n/a	        </td><td>現在のキーを示す変数の名前</td></tr></tbody></table><ul><li>必須の属性は from と item です。
</li><li>from 属性は、通常は値の配列で、 &lt;{foreach}&gt; のループ回数を決定するために使われます。
</li></ul><h5 id="h5-.E4.BE.8B..20item.20.E5.B1.9E.E6.80.A7">例. item 属性</h5><pre>&lt;?php
$arr = array(1000, 1001, 1002);
$simplate-&gt;assign('myArray', $arr);
?&gt;
</pre><p>$myArray を順序なしリストで出力するテンプレート
</p><pre>&lt;ul&gt;
&lt;{foreach from=$myArray item=foo}&gt;
    &lt;li&gt;&lt;{$foo}&gt;&lt;/li&gt;
&lt;{/foreach}&gt;
&lt;/ul&gt;
</pre><p>出力
</p><pre>&lt;ul&gt;
    &lt;li&gt;1000&lt;/li&gt;
    &lt;li&gt;1001&lt;/li&gt;
    &lt;li&gt;1002&lt;/li&gt;
&lt;/ul&gt;
</pre><h5 id="h5-.E4.BE.8B..20item.20.E3.81.8A.E3.82.88.E3.81.B3.20key.20.E5.B1.9E.E6.80.A7.E3.81.AE.E8.AA.AC.E6.98.8E">例. item および key 属性の説明</h5><pre>&lt;?php
$arr = array(9 =&gt; 'Tennis', 3 =&gt; 'Swimming', 8 =&gt; 'Coding');
$simplate-&gt;assign('myArray', $arr);
?&gt;
</pre><p>$myArray を キー/値 のペアで出力するテンプレート。 PHP の <a href="http://php.net/foreach" class="external" rel="nofollow">foreach</a> と似ています。
</p><pre>&lt;ul&gt;
&lt;{foreach from=$myArray key=k item=v}&gt;
   &lt;li&gt;&lt;{$k}&gt;: &lt;{$v}&gt;&lt;/li&gt;
&lt;{/foreach}&gt;
&lt;/ul&gt;
</pre><p>出力
</p><pre>&lt;ul&gt;
    &lt;li&gt;9: Tennis&lt;/li&gt;
    &lt;li&gt;3: Swimming&lt;/li&gt;
    &lt;li&gt;8: Coding&lt;/li&gt;
&lt;/ul&gt;
</pre><h5 id="h5-.E4.BE.8B..20.7Bforeach.7D.20.E3.81.A7.E9.80.A3.E6.83.B3.E9.85.8D.E5.88.97.E3.81.AE.20item.20.E5.B1.9E.E6.80.A7.E3.82.92.E6.8C.87.E5.AE.9A.E3.81.99.E3.82.8B.E4.BE.8B">例. {foreach} で連想配列の item 属性を指定する例</h5><pre>&lt;?php
$items_list = array(23 =&gt; array('no' =&gt; 2456, 'label' =&gt; 'Salad'),
                    96 =&gt; array('no' =&gt; 4889, 'label' =&gt; 'Cream')
                    );
$simplate-&gt;assign('items', $items_list);
?&gt;
</pre><p>$items と $myId を url に出力するテンプレート
</p><pre>&lt;ul&gt;
&lt;{foreach from=$items key=myId item=i}&gt;
  &lt;li&gt;&lt;a href=&quot;item.php?id=&lt;{$myId}&gt;&quot;&gt;&lt;{$i.no}&gt;: &lt;{$i.label}&gt;&lt;/li&gt;
&lt;{/foreach}&gt;
&lt;/ul&gt;
</pre><p>出力
</p><pre>&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;item.php?id=23&quot;&gt;2456: Salad&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;item.php?id=96&quot;&gt;4889: Cream&lt;/li&gt;
&lt;/ul&gt;
</pre><h5 id="h5-.E4.BE.8B..20.7Bforeach.7D.20.E3.81.A7.20item.20.E3.81.A8.20key.20.E3.82.92.E3.83.8D.E3.82.B9.E3.83.88.E3.81.99.E3.82.8B.E4.BE.8B">例. {foreach} で item と key をネストする例</h5><p>配列を Simplate に割り当てます。key にはループする値のキーが含まれます。
</p><pre>&lt;?php
 $simplate-&gt;assign('contacts', array(
                             array('phone' =&gt; '1',
                                   'fax' =&gt; '2',
                                   'cell' =&gt; '3'),
                             array('phone' =&gt; '555-4444',
                                   'fax' =&gt; '555-3333',
                                   'cell' =&gt; '760-1234')
                             ));
?&gt;
</pre><p>$contact を出力するテンプレート
</p><pre>&lt;{foreach item=contact from=$contacts}&gt;
  &lt;hr /&gt;
  &lt;{foreach key=key item=item from=$contact}&gt;
    &lt;{$key}&gt;: &lt;{$item}&gt;&lt;br /&gt;
  &lt;{/foreach}&gt;
&lt;{/foreach}&gt;
</pre><p>出力
</p><pre>&lt;hr /&gt;
  phone: 1&lt;br /&gt;
  fax: 2&lt;br /&gt;
  cell: 3&lt;br /&gt;
&lt;hr /&gt;
  phone: 555-4444&lt;br /&gt;
  fax: 555-3333&lt;br /&gt;
  cell: 760-1234&lt;br /&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">5章 組み込み関数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions.if">&lt;{if}&gt;&lt;{elseif}&gt;&lt;{else}&gt;</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">
    <title>Basic.syntax.variable</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable</link>
    <dc:identifier>Basic.syntax.variable</dc:identifier>
    <dc:date>2009-11-15T20:32:55+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 変数 ===

テンプレート変数は、先頭にドル記号 $ を付けます。
変数名には [http://php.net/language.variables PHP の変数] と同様に英数字およびアンダースコアが使用できます。
配列の参照には、インデックスの数値もしくはそれ以外の文字を使用できます。
オブジェクトのプロパテ]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">コメント</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a>
</div></div>
<h3 id="h3-.E5.A4.89.E6.95.B0">変数</h3><p>テンプレート変数は、先頭にドル記号 $ を付けます。
変数名には <a href="http://php.net/language.variables" class="external" rel="nofollow">PHP の変数</a> と同様に英数字およびアンダースコアが使用できます。
配列の参照には、インデックスの数値もしくはそれ以外の文字を使用できます。
オブジェクトのプロパティとメソッドの参照も同様です。
</p><h5 id="h5-.E4.BE.8B..20.E5.A4.89.E6.95.B0">例. 変数</h5><pre>&lt;{$foo}&gt;        &lt;-- 単純な変数 (配列やオブジェクト以外) を表示します。
&lt;{$foo.4}&gt;      &lt;-- 0 から始まるインデックスを持った配列の 5 番目の要素を表示します。
&lt;{$foo.bar}&gt;    &lt;-- &quot;bar&quot; というキーに対応する配列の値を表示します。PHP の $foo['bar'] と同じです。
&lt;{$foo-&gt;bar}&gt;   &lt;-- オブジェクトのプロパティ &quot;bar&quot; を表示します。$foo が連想配列の場合 $foo['bar'] と同じです。
&lt;{$foo-&gt;bar()}&gt; &lt;-- オブジェクトのメソッド &quot;bar&quot; の返り値を表示します。
&lt;{$foo[bar]}&gt;   &lt;-- section ループ内でのみ正当な構文です。&lt;{section}&gt; の項を参照のこと。

その他多くの組み合わせが可能です。

&lt;{$foo.bar.baz}&gt;
&lt;{$foo.4.baz}&gt;
&lt;{$foo.bar.baz.4}&gt;
&lt;{$foo-&gt;bar-&gt;baz()}&gt;
&lt;{$foo-&gt;bar($baz, 2, $bar)}&gt; &lt;-- パラメータを渡します。
</pre><p><a href="http://sourceforge.jp/projects/simplate/wiki/Variable.simplate">$simplate</a>、<a href="http://sourceforge.jp/projects/simplate/wiki/Api.functions.assign">assign()</a> も参照してください。
</p><h4 id="h4-Smarty.20.E3.81.A8.E3.81.AE.E5.B7.AE.E5.88.86">Smarty との差分</h4><p>Smarty では可能な以下のような書き方はサポートしていません。
</p><pre>&lt;{$foo.$bar}&gt;   &lt;-- Smarty の場合、これは PHP の $foo[$bar] と同じですが、未サポートです。
</pre><p>連想配列のキーを変数で与えたい場合は php プログラムで工夫する必要があります。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.comment">コメント</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">
    <title>Basic.syntax.function</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function</link>
    <dc:identifier>Basic.syntax.function</dc:identifier>
    <dc:date>2009-11-15T20:32:40+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 関数 ===

すべての Simplate タグは、 [Basic.syntax.variable 変数] を出力するか何らかの関数を呼び出す動作をします。
関数は、 &lt;{funcname attr1=&#039;val1&#039; attr2=&#039;val2&#039;}&gt; のように関数名とその []]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a>
</div></div>
<h3 id="h3-.E9.96.A2.E6.95.B0">関数</h3><p>すべての Simplate タグは、 <a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">変数</a> を出力するか何らかの関数を呼び出す動作をします。
関数は、 &lt;{funcname attr1='val1' attr2='val2'}&gt; のように関数名とその <a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a> をデリミタで囲みます。
</p><h5 id="h5-.E4.BE.8B..20.E9.96.A2.E6.95.B0.E3.81.AE.E6.A7.8B.E6.96.87">例. 関数の構文</h5><pre>&lt;{include file='header.tpl'}&gt;

&lt;{if $logged_in}&gt;
    ようこそ、&lt;{$name}&gt;!
&lt;{else}&gt;
    やぁ、&lt;{$name}&gt;
&lt;{/if}&gt;
</pre><ul><li><a href="http://sourceforge.jp/projects/simplate/wiki/Builtin.functions">組み込み関数</a> とカスタム関数は、テンプレート内では同じ構文です。
</li><li>組み込み関数とは Simplate の <strong>内部で</strong> 動作する関数で、たとえば &lt;{if}&gt;、 &lt;{section}&gt; および &lt;{php}&gt; などのことです。これらを変更したり修正したりすることはありません。
</li></ul><h4 id="h4-Smarty.20.E3.81.A8.E3.81.AE.E5.B7.AE.E5.88.86">Smarty との差分</h4><p>Simplate ではカスタム関数をサポートしていません。
</p><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.variable">変数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">属性</a>
</div></div>]]>
    </content:encoded>
      </item>
        <item rdf:about="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute">
    <title>Basic.syntax.attribute</title>
    <link>http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.attribute</link>
    <dc:identifier>Basic.syntax.attribute</dc:identifier>
    <dc:date>2009-11-15T20:32:27+09:00</dc:date>
        <description>
      <![CDATA[[[PageNavi(NavigationList)]]

=== 属性 ===

ほとんどの [Basic.syntax.function 関数] には、 それらの動作を指定したり修正するための属性があります。
Simplate 関数の属性は HTML の属性にかなり近いものです。
静的な値はクォートで囲む必要はありませんが、リテラル文字列であるべきです。

===== 例. 関]]>
    </description>
    <content:encoded>
      <![CDATA[<div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div></div>
<h3 id="h3-.E5.B1.9E.E6.80.A7">属性</h3><p>ほとんどの <a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a> には、 それらの動作を指定したり修正するための属性があります。
Simplate 関数の属性は HTML の属性にかなり近いものです。
静的な値はクォートで囲む必要はありませんが、リテラル文字列であるべきです。
</p><h5 id="h5-.E4.BE.8B..20.E9.96.A2.E6.95.B0.E3.81.AE.E5.B1.9E.E6.80.A7.E3.81.AE.E6.A7.8B.E6.96.87">例. 関数の属性の構文</h5><pre>&lt;{include file='header.tpl'}&gt;

&lt;{include file=&quot;$includeFile&quot;}&gt;

&lt;{section name=i loop=$ary }&gt;
&lt;tr&gt;&lt;td&gt;&lt;{$ary[i]}&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;{$ary[i]+1}&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;{/section}&gt;
</pre><div class="pagenavi"><div class="up"><span class="label">Up: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax">3章 基本構文</a>
</div><div class="prev"><span class="label">Prev: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Basic.syntax.function">関数</a>
</div><div class="next"><span class="label">Next: </span><a href="http://sourceforge.jp/projects/simplate/wiki/Variable">4章 変数</a>
</div></div>]]>
    </content:encoded>
      </item>
    </rdf:RDF>

