Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

$compile_id

コンパイルファイルを識別するための id です。すべての関数呼び出しで毎回 $compile_id を渡すかわりに $compile_id を指定すると、その後は暗黙のうちにこれを使用します。

$compile_id を使用すると、同一の $compile_dir を別々の $template_dirs で使用できないという制限を回避できます。 異なる $compile_id をそれぞれの $template_dir で指定すると、Smarty はコンパイルしたテンプレートを $compile_id で区別します。

例として、コンパイル時刻でテンプレートをローカライズ (言語依存のパーツを翻訳) する prefilter を用いる場合、$compile_id に現在の言語を使用することで、各言語についてのコンパイルしたテンプレートのセットを得ることができます。

別の例としては、複数のドメイン/複数のバーチャルホスト をまたがって同じコンパイルディレクトリを使用する場合があります。

Example 12.6. バーチャルホスト環境での $compile_id


<?php

$smarty->compile_id = $_SERVER['SERVER_NAME'];
$smarty->compile_dir = '/path/to/shared_compile_dir';

?>

  

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors