Get Smarty

Donate

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

Buy cheap glasses from Cheapglasses123.com and save up to 80%.

Where to buy prescription glasses? EyewearCanada.com is your best choice!

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Shop for 2018 World Cup Football Boots Online sale at guthjcc.com

Browse best 2018 world cup soccer cleats and shoes from SoccerAzteca.com

Advertisement

$compile_id

永久的编译标识id。这是可选的设置,在每个函数调用的时候均被传入同一个$compile_id,你可以设置$compile_id,随后这个标识id将被隐含地调用。

$compile_id有个限制就是你不能够在多个模板目录 $template_dirs的情况下使用同一个编译标识id$compile_dir。如果你单独为每个模板目录都设置一个$compile_id,那么Smarty将自动按$compile_id来对编译文件进行区分。

举个例子,你会在编译时用前置过滤器来本地化你的模板(也就是每个语言均分开),可以用语言名作为$compile_id,那么你就可以为每种语言单独进行编译了。

在多域名 / 多虚拟主机的环境中,其他应用程序也有可能使用同一个编译目录,

Example 13.1. 虚拟主机环境的$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 15 plus 1? (Are you human?)

Advertisement