Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > by-pkgid > 8377d4bb25a3992aad680df2952f4b71 > files > 156

php-smarty-doc-2.6.26-1mdv2010.0.noarch.rpm

<HTML
><HEAD
><TITLE
>$compile_id</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Smarty Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="Smarty Class Variables"
HREF="api.variables.html"><LINK
REL="PREVIOUS"
TITLE="$error_reporting"
HREF="variable.error.reporting.html"><LINK
REL="NEXT"
TITLE="$use_sub_dirs"
HREF="variable.use.sub.dirs.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Smarty Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="variable.error.reporting.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 12. Smarty Class Variables</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="variable.use.sub.dirs.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="variable.compile.id"
></A
>$compile_id</H1
><P
>&#13;  Persistant compile identifier. As an alternative to passing the same
  <TT
CLASS="parameter"
><I
>$compile_id</I
></TT
> to each and every function call, you can set this
  <TT
CLASS="parameter"
><I
>$compile_id</I
></TT
> and it will be used implicitly thereafter.
 </P
><P
>&#13;  With a <TT
CLASS="parameter"
><I
>$compile_id</I
></TT
> you can work around the limitation
  that you cannot use the same
  <A
HREF="variable.compile.dir.html"
><TT
CLASS="parameter"
><I
>$compile_dir</I
></TT
></A
>
  for different <A
HREF="api.variables.html#variable.template.dir"
>&#13;  <TT
CLASS="parameter"
><I
>$template_dirs</I
></TT
></A
>.  If you set a distinct
  <TT
CLASS="parameter"
><I
>$compile_id</I
></TT
> for each
  <A
HREF="api.variables.html#variable.template.dir"
><TT
CLASS="parameter"
><I
>$template_dir</I
></TT
>
  </A
> then Smarty can tell the compiled templates apart by their
  <TT
CLASS="parameter"
><I
>$compile_id</I
></TT
>.
 </P
><P
>&#13;  If you have for example a
  <A
HREF="plugins.prefilters.postfilters.html"
>prefilter</A
>
  that localizes your templates
  (that is: translates language dependend parts) at compile time, then
  you could use the current language as <TT
CLASS="parameter"
><I
>$compile_id</I
></TT
> and
  you will get a  set of compiled templates for each language you use.
 </P
><P
>&#13;  Another application would be to use the same compile directory across
  multiple domains / multiple virtual hosts.
 </P
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN5324"
></A
><P
><B
>Example 12-6. $compile_id in a virtual host enviroment</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$smarty</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">compile_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$_SERVER</span><span style="color: #007700">[</span><span style="color: #DD0000">'SERVER_NAME'</span><span style="color: #007700">];<br /></span><span style="color: #0000BB">$smarty</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">compile_dir&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'/path/to/shared_compile_dir'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="variable.error.reporting.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="variable.use.sub.dirs.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>$error_reporting</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="api.variables.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>$use_sub_dirs</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>