Get Smarty

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:

Check reviews of PHP Web Hosting, compatible with Smarty Templates

$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.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 4 plus 11? (Are you human?)

Sponsors [info]

Cheap Website Hosting @hostdone.com
email marketing @ActiveCampaign
broadband deals @BroadbandGenie
Best UK Web Hosting @webhost.uk.net
Reliable UK and US Web Hosting @rshosting.com
Cheap US and UK Web Hosting @infrenion.com
I.T Certification Exams @pass-guaranteed.com
Certification Practice Tests @firsttrycertify.com
Certification Practice Exam Questions @ace-it-certifications.com
Broadband Speed Test @broadbandspeed.co.uk
bulk email software @americaint.com
ASP.NET hosting @aspnethosting.co.uk