mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
Big update. Revision tag for all files. Some updates. Now I can update it
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<!-- EN-Revision: 1.3 Maintainer: thomasgm Status: ready -->
|
||||
<chapter id="resources">
|
||||
<title>Recursos</title>
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: thomasgm Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: thomasgm Status: ready -->
|
||||
<chapter id="troubleshooting">
|
||||
<title>Localiza<EFBFBD><EFBFBD>o de Erros</title>
|
||||
<para></para>
|
||||
@@ -43,12 +42,123 @@ Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75
|
||||
Quando voc<6F> encontra um erro de an<61>lise do PHP, o n<>mero da linha do erro corresponder<65> ao
|
||||
script PHP compilado, n<>o o template em si. Normalmente voc<6F> pode no template localizar o
|
||||
erro de sintaxe. Aqui algumas coisas para voc<6F> procurar:
|
||||
falta de fechamento de tags para {if}{/if} ou
|
||||
{section}{/section}, ou erro de l<>gica dentro de uma tag {if}.
|
||||
falta de fechamento de tags para <link linkend="language.function.if">{if}{/if}</link> ou
|
||||
<link linkend="language.function.section">{section}{/section}</link>, ou erro de l<>gica dentro de uma tag {if}.
|
||||
Se voc<6F> n<>o conseguir encontrar o erro, talvez seja necess<73>rio abrir
|
||||
o arquivo PHP compilado e ir at<61> o n<>mero da linha exibido, para saber
|
||||
onde se encontra o erro correspondente no template.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Other common errors</title>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Warning: Smarty error: unable to read resource: "index.tpl" in...
|
||||
or
|
||||
Warning: Smarty error: unable to read resource: "site.conf" in...
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
The <link linkend="variable.template.dir">$template_dir</link>
|
||||
is incorrect, doesn't exist or
|
||||
the file <filename>index.tpl</filename> is not in the
|
||||
<filename class="directory">templates/</filename> directory
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
A <link linkend="language.function.config.load">{config_load}</link>
|
||||
function is within a template (or
|
||||
<link linkend="api.config.load">config_load()</link>
|
||||
has been called) and either
|
||||
<link linkend="variable.config.dir">$config_dir</link>
|
||||
is incorrent , does not exist or
|
||||
<filename>site.conf</filename> is not in the directory.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist,
|
||||
or is not a directory...
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
Either the
|
||||
<link linkend="variable.compile.dir">$compile_dir</link>
|
||||
is incorrectly set, the directory does not exist,
|
||||
or <filename>templates_c</filename> is a
|
||||
file and not a directory.
|
||||
</para>
|
||||
</listitem><listitem>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Fatal error: Smarty error: unable to write to $compile_dir '....
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
The <link linkend="variable.compile.dir">$compile_dir</link>
|
||||
is not writable by the web server. See the bottom of the
|
||||
<link linkend="installing.smarty.basic">installing smarty</link> page
|
||||
for permissions.
|
||||
</para>
|
||||
|
||||
</listitem><listitem>
|
||||
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Fatal error: Smarty error: the $cache_dir 'cache' does not exist,
|
||||
or is not a directory. in /..
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
This means that
|
||||
<link linkend="variable.caching">$caching</link> is enabled and either;
|
||||
the
|
||||
<link linkend="variable.cache.dir">$cache_dir</link>
|
||||
is incorrectly set, the directory does not exist,
|
||||
or <filename>cache</filename> is a
|
||||
file and not a directory.
|
||||
</para>
|
||||
|
||||
</listitem><listitem>
|
||||
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Fatal error: Smarty error: unable to write to $cache_dir '/...
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
This means that
|
||||
<link linkend="variable.caching">$caching</link> is enabled and the
|
||||
<link linkend="variable.cache.dir">$cache_dir</link>
|
||||
is not writable by the web server. See the bottom of the
|
||||
<link linkend="installing.smarty.basic">installing smarty</link> page
|
||||
for permissions.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="chapter.debugging.console">debugging</link>,
|
||||
<link linkend="variable.error.reporting">$error_reporting</link>
|
||||
and
|
||||
<link linkend="api.trigger.error">trigger_error()</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.capitalize">
|
||||
<title>capitalize</title>
|
||||
<para>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.cat">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.cat">
|
||||
<title>cat</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.characters">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.count.characters">
|
||||
<title>count_characters</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.count.paragraphs">
|
||||
<title>count_paragraphs</title>
|
||||
<para>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.sentences">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.count.sentences">
|
||||
<title>count_sentences</title>
|
||||
<para>
|
||||
Isto <20> usado para contar o n<>mero de senten<65>as em uma vari<72>vel.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.words">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.count.words">
|
||||
<title>count_words</title>
|
||||
<para>
|
||||
Isto <20> usado para contar o n<>mero de palavras em uma vari<72>vel.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.date.format">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.date.format">
|
||||
<title>date_format</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.default">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.default">
|
||||
<title>default</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.escape">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.escape">
|
||||
<title>escape</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="6">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.indent">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.indent">
|
||||
<title>indent</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.lower">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.lower">
|
||||
<title>lower</title>
|
||||
<para>
|
||||
Isto <20> usado para converter para min<69>sculas uma vari<72>vel.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.nl2br">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.nl2br">
|
||||
<title>nl2br</title>
|
||||
<para>
|
||||
Todas as quebras de linha ser<65>o convertidas para <br /> na vari<72>vel
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.regex.replace">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.regex.replace">
|
||||
<title>regex_replace</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.replace">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.replace">
|
||||
<title>replace</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.spacify">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.spacify">
|
||||
<title>spacify</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.string.format">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.string.format">
|
||||
<title>string_format</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.strip.tags">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.strip.tags">
|
||||
<title>strip_tags</title>
|
||||
<para>
|
||||
Isto retira as tags de marca<63><61>o, basicamente tudo entre < e >.
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.truncate">
|
||||
<title>truncate</title>
|
||||
<informaltable frame="all">
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.upper">
|
||||
<title>upper</title>
|
||||
<para>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.modifier.wordwrap">
|
||||
<title>wordwrap</title>
|
||||
<informaltable frame="all">
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.assigned.variables">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.assigned.variables">
|
||||
<title>Vari<EFBFBD>veis definidas do PHP</title>
|
||||
<para>
|
||||
Vari<72>veis que s<>o definidas do PHP s<>o referenciadas precedendo elas
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.config.variables">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.config.variables">
|
||||
<title>Vari<EFBFBD>veis carregadas de arquivos de configura<72><61>o</title>
|
||||
<para>
|
||||
Vari<72>veis que s<>o carregadas de arquivos de configura<72><61>o s<>o referenciadas
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="language.variables.smarty">
|
||||
<title>A vari<72>vel reservada {$smarty}</title>
|
||||
<para>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: thomasgm Status: ready -->
|
||||
<!-- EN-Revision: 1.13 Maintainer: fernandoc Status: ready -->
|
||||
|
||||
<part id="getting.started">
|
||||
<title>Iniciando</title>
|
||||
|
||||
@@ -10,7 +10,11 @@
|
||||
O Smarty <20> um sistema de templates para PHP. Mais especificamente, ele fornece uma maneira
|
||||
f<>cil de controlar a separa<72><61>o da aplica<63><61>o l<>gica e o conte<74>do de sua apresenta<74><61>o. Isto <20>
|
||||
melhor descrito em uma situa<75><61>o onde o programador da aplica<63><61>o e o designer do template executam
|
||||
diferentes fun<75><6E>es, ou na maioria dos casos n<>o s<>o a mesma pessoa. Por exemplo, digamos que voc<6F>
|
||||
diferentes fun<75><6E>es, ou na maioria dos casos n<>o s<>o a mesma pessoa.
|
||||
|
||||
</para>
|
||||
<para>
|
||||
Por exemplo, digamos que voc<6F>
|
||||
est<73> criando uma p<>gina para web para mostrar um artigo de um jornal. O autor, a manchete,
|
||||
a conclus<75>o e o corpo do artigo s<>o elementos de conte<74>do, eles n<>o cont<6E>m informa<6D><61>o alguma
|
||||
sobre como eles devem ser mostrados. Ele s<>o enviados ao Smarty pela aplica<63><61>o, ent<6E>o o designer
|
||||
@@ -30,7 +34,7 @@
|
||||
das tabelas, colocar o texto de uma vari<72>vel em mai<61>sculo, percorrer uma matriz de dados e mostr<74>-la, etc.
|
||||
s<>o todos exemplos de apresenta<74><61>o l<>gica. Isto n<>o significa que o Smarty for<6F>a a separa<72><61>o da l<>gica de
|
||||
neg<65>cios e da l<>gica de apresenta<74><61>o. O Smarty n<>o tem conhecimento do que <20> o que em sua aplica<63><61>o, portanto
|
||||
colocar sua a l<>gica de neg<65>cio no template <20> problema seu. Caso voc<6F> deseje que n<>o haja NENHUMA l<>gica
|
||||
colocar sua a l<>gica de neg<65>cio no template <20> problema seu. Caso voc<6F> deseje que n<>o haja <emphasis>nenhuma</emphasis> l<>gica
|
||||
em seus templates voc<6F> pode certamente fazer isso trocando o conte<74>do para textos e vari<72>veis somente.
|
||||
<!-- ficou legal o texto abaixo, mas n<>o segue exatamente toda tradu<64><75>o, espero aprova<76><61>o do meu acima, ou mistura entre os dois:
|
||||
Agora um resumo sobre o que o Smarty faz e N<>O faz. O Smarty n<>o tenta separar completamente
|
||||
@@ -52,19 +56,80 @@
|
||||
Algumas das caracter<65>sticas do Smarty:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>Ele <20> extremamente r<>pido.</para></listitem>
|
||||
<listitem><para>Ele <20> eficiente visto que o interpretador do PHP faz o trabalho mais pesado.</para></listitem>
|
||||
<listitem><para>Sem elevadas interpreta<74><61>es de template, apenas compila uma vez.</para></listitem>
|
||||
<listitem><para>Ele est<73> atento para s<> recompilar os arquivos de template que foram mudados.</para></listitem>
|
||||
<listitem><para>Voc<EFBFBD> pode criar <link linkend="language.custom.functions">fun<EFBFBD><EFBFBD>es customizadas</link> e <link linkend="language.modifiers">modificadores de vari<72>veis</link> customizados, de modo que a linguagem de template <20> extremamente extens<6E>vel.</para></listitem>
|
||||
<listitem><para>Delimitadores de tag configur<75>veis, sendo assim voc<6F> pode usar {}, {{}}, <!--{}-->, etc.</para></listitem>
|
||||
<listitem><para>Os construtoress if/elseif/else/endif s<>o passados para o interpretador de PHP, assim a sintaxe de express<73>o {if ...} pode ser tanto simples quanto complexa da forma que voc<6F> queira.</para></listitem>
|
||||
<listitem><para>Aninhamento ilimitado de sections, ifs, etc. permitidos.</para></listitem>
|
||||
<listitem><para><EFBFBD> poss<73>vel embutir o c<>digo PHP diretamente em seus arquivos de template, apesar de que isto pode n<>o ser necess<73>rio (n<>o recomendado) visto que a ferramenta <20> t<>o customiz<69>vel.</para></listitem>
|
||||
<listitem><para>Suporte de caching embutido</para></listitem>
|
||||
<listitem><para>Fontes de template arbitr<74>rios</para></listitem>
|
||||
<listitem><para>Fun<EFBFBD><EFBFBD>es de manipula<6C><61>o de cache customizadas</para></listitem>
|
||||
<listitem><para>Arquitetura de Plugin</para></listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Ele <20> extremamente r<>pido.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Ele <20> eficiente visto que o interpretador do PHP faz o trabalho mais pesado.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Sem elevadas interpreta<74><61>es de template, apenas compila uma vez.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Ele est<73> atento para s<> recompilar os arquivos de template que foram mudados.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Voc<6F> pode fazer <link linkend="language.custom.functions">fun<EFBFBD><EFBFBD>es pr<70>prias</link>
|
||||
e seus pr<70>prios <link linkend="language.modifiers">modificadores de vari<72>veis</link>, assim
|
||||
a linguagem de templates <20> extremamente extens<6E>vel.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link linkend="variable.left.delimiter">Delimitadores de tag</link>
|
||||
configur<75>veis, sendo assim voc<6F> pode usar {}, {{}}, <!--{}-->, etc.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Os construtores <link linkend="language.function.if">if/elseif/else/endif</link> s<>o passados
|
||||
para o interpretador de PHP, assim a sintaxe de express<73>o {if ...} pode ser tanto simples quanto
|
||||
complexa da forma que voc<6F> queira.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Aninhamento ilimitado de <link linkend="language.function.section">sections</link>,
|
||||
ifs, etc. permitidos.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<20> poss<73>vel <link linkend="language.function.php">embutir o c<>digo PHP</link> diretamente em
|
||||
seus arquivos de template, apesar de que isto pode n<>o ser necess<73>rio (n<>o recomendado) visto que a
|
||||
ferramenta <20> t<>o customiz<69>vel.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Suporte de <link linkend="caching">caching embutido</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link linkend="template.resources">Fontes de template</link> arbitr<74>rios.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Fun<75><6E>es de <link linkend="section.template.cache.handler.func">manipula<EFBFBD><EFBFBD>o
|
||||
de cache</link> customizadas.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link linkend="plugins">Arquitetura de Plugin</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</chapter>
|
||||
<chapter id="installation">
|
||||
@@ -80,56 +145,70 @@
|
||||
<sect1 id="installing.smarty.basic">
|
||||
<title>Instala<EFBFBD><EFBFBD>o B<>sica</title>
|
||||
<para>
|
||||
Instale os arquivos da biblioteca do Smarty que est<73>o no diret<65>rio /libs/ da
|
||||
Instale os arquivos da biblioteca do Smarty que est<73>o no subdiret<EFBFBD>rio /libs/ da
|
||||
distribui<75><69>o. Estes s<>o os arquivos PHP que voc<6F> N<>O PRECISA editar. Eles s<>o comuns
|
||||
a todas as aplica<63><61>es e eles s<> s<>o atualizados quando voc<6F> atualiza para uma nova
|
||||
vers<72>o do Smarty.
|
||||
</para>
|
||||
<example>
|
||||
<title>Arquivos da biblioteca do Smarty</title>
|
||||
<title>Arquivos da biblioteca do Smarty necess<73>rios</title>
|
||||
<screen>
|
||||
Smarty.class.php
|
||||
Smarty_Compiler.class.php
|
||||
Config_File.class.php
|
||||
debug.tpl
|
||||
/core/*.php (todos eles)
|
||||
/plugins/*.php (todos eles)
|
||||
/internals/*.php (all of them)
|
||||
/plugins/*.php (todos eles para ser seguro, talv<6C>s a sua pagina precise de apenas alguns)
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
O Smarty utiliza uma constante do PHP chamada <link
|
||||
linkend="constant.smarty.dir">SMARTY_DIR</link> que <20> o caminho para diret<65>rio da
|
||||
biblioteca do Smarty. Basicamente, se sua aplica<63><61>o pode encontrar o arquivo
|
||||
<emphasis>Smarty.class.php</emphasis>, voc<6F> n<>o precisa definir a constante
|
||||
SMARTY_DIR, o Smarty ir<69> localiz<69>-la sozinho. Sendo assim, se o arquivo <emphasis>Smarty.class.php</emphasis>
|
||||
n<>o est<73> em seu include_path, ou voc<6F> n<>o fornece um caminho absoluto para ele em sua aplica<63><61>o, ent<6E>o
|
||||
voc<6F> deve definir a constante SMARTY_DIR manualmente. A constante SMARTY_DIR <emphasis>deve</emphasis>
|
||||
conter uma barra de seguimento.
|
||||
O Smarty utiliza uma <ulink url="&url.php-manual;define">constante</ulink> do PHP chamada
|
||||
<link linkend="constant.smarty.dir">SMARTY_DIR</link> que <20> o
|
||||
<emphasis role="bold">caminho completo</emphasis> para o diret<65>rio 'libs/' do Smarty.
|
||||
Basicamente, se sua aplica<63><61>o puder encontrar o arquivo
|
||||
<filename>Smarty.class.php</filename>, voc<6F> n<>o precisa
|
||||
definir <link linkend="constant.smarty.dir">SMARTY_DIR</link>,
|
||||
o Smarty ir<69> encontrar por si s<>. Entretanto, se
|
||||
<filename>Smarty.class.php</filename> n<>o estiver em seu include_path, ou voc<6F>
|
||||
n<>o indicar um caminho absoluto para ele em sua aplica<63><61>o, ent<6E>o voc<6F>
|
||||
dever<65> definir SMARTY_DIR manualmente. SMARTY_DIR <emphasis role="bold">deve incluir uma
|
||||
barra ao final</emphasis>.
|
||||
</para>
|
||||
<para>
|
||||
Aqui est<73> um exemplo de como voc<6F> cria uma inst<73>ncia do Smarty em seus scripts PHP:
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Cria uma inst<73>ncia Smarty do Smarty</title>
|
||||
<title>Cria uma inst<73>ncia do Smarty</title>
|
||||
<screen>
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
NOTE: Smarty has a capital 'S'
|
||||
require_once('Smarty.class.php');
|
||||
$smarty = new Smarty();
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Tente rodar o script acima. Se voc<6F> obtiver um erro dizendo que o arquivo
|
||||
<emphasis>Smarty.class.php</emphasis> n<>o p<>de ser encontrado, voc<6F> tem que fazer uma
|
||||
Tente rodar o script acima. Se voc<6F> obtiver um erro dizendo que o arquivo
|
||||
<filename>Smarty.class.php</filename> n<>o p<>de ser encontrado, voc<6F> tem que fazer uma
|
||||
das coisas a seguir:
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Fornecer um caminho absoluto para o arquivo da biblioteca</title>
|
||||
<title>Definir a constante SMARTY_DIR manualmente</title>
|
||||
<screen>
|
||||
require('/usr/local/lib/php/Smarty/Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
// *nix style (note capital 'S')
|
||||
define('SMARTY_DIR', '/usr/local/lib/php/Smarty-v.e.r/libs/');
|
||||
|
||||
// windows style
|
||||
define('SMARTY_DIR', 'c:/webroot/libs/Smarty-v.e.r/libs/');
|
||||
|
||||
// hack version example that works on both *nix and windows
|
||||
// Smarty is assumend to be in 'includes/' dir under current script
|
||||
define('SMARTY_DIR',str_replace("\\","/",getcwd()).'/includes/Smarty-v.e.r/libs/');
|
||||
|
||||
require_once(SMARTY_DIR . 'Smarty.class.php');
|
||||
$smarty = new Smarty();
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -154,20 +233,34 @@ $smarty = new Smarty;
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Agora que os arquivos da biblioteca est<73>o no lugar, chegou a hora de configurar os
|
||||
diret<65>rios do Smarty para a sua aplica<63><61>o. O Smarty requer quatro diret<65>rios que s<>o
|
||||
(por defini<6E><69>o) chamados de <emphasis>templates</emphasis>,
|
||||
<emphasis>templates_c</emphasis>, <emphasis>configs</emphasis> e
|
||||
<emphasis>cache</emphasis>. Cada um destes s<>o defin<69>veis pelas propriedades da classe do Smarty
|
||||
<emphasis>$template_dir</emphasis>,
|
||||
<emphasis>$compile_dir</emphasis>, <emphasis>$config_dir</emphasis>, e
|
||||
<emphasis>$cache_dir</emphasis> respectivamente. <20> altamente recomendado que voc<6F> configure
|
||||
um grupo separado destes diret<65>rios
|
||||
para cada aplica<63><61>o que utilizar<61> o Smarty.
|
||||
Agora que os arquivos da biblioteca est<73>o no lugar, <EFBFBD> hora de configurar os diret<EFBFBD>rios
|
||||
do Smarty para a sua aplica<63><61>o.
|
||||
</para>
|
||||
<para>
|
||||
O Smarty necessita de quatro diret<65>rios, que s<>o chamados
|
||||
por padr<64>o <filename class="directory">'templates/'</filename>,
|
||||
<filename class="directory">'templates_c/'</filename>, <filename
|
||||
class="directory">'configs/'</filename> e <filename
|
||||
class="directory">'cache/'</filename>.
|
||||
</para>
|
||||
<para>
|
||||
Cada um deles pode ser definido
|
||||
pelas propriedades da classe Smarty
|
||||
<link linkend="variable.template.dir">
|
||||
<varname>$template_dir</varname></link>,
|
||||
<link linkend="variable.compile.dir">
|
||||
<varname>$compile_dir</varname></link>,
|
||||
<link linkend="variable.config.dir">
|
||||
<varname>$config_dir</varname></link>, e
|
||||
<link linkend="variable.cache.dir">
|
||||
<varname>$cache_dir</varname></link> repectivamente.
|
||||
<20> altamente recomendado que
|
||||
voc<6F> configure um conjunto diferente destes diret<65>rios para cada aplica<63><61>o
|
||||
que for usar o Smarty.
|
||||
</para>
|
||||
<para>
|
||||
Certifique-se que voc<6F> sabe a localiza<7A><61>o do 'document root' do seu servidor web. Em nosso exemplo,
|
||||
o 'document root' <20> "/web/www.mydomain.com/docs/". Os diret<65>rios do Smarty
|
||||
o 'document root' <20> <filename class="directory">"/web/www.mydomain.com/docs/"</filename>. Os diret<65>rios do Smarty
|
||||
s<> s<>o acessados pela biblioteca do Smarty e nunca acessados diretamente pelo navegador. Ent<6E>o para
|
||||
evitar qualquer preocupa<70><61>o com seguran<61>a, <20> recomendado colocar estes diret<65>rios
|
||||
<emphasis>fora</emphasis> do document root.
|
||||
@@ -178,24 +271,29 @@ $smarty = new Smarty;
|
||||
de uma conven<65><6E>o de nomea<65><61>o de diret<65>rio. Voc<6F> pode usar o mesmo ambiente para qualquer
|
||||
aplica<63><61>o, apenas substitua "guestbook" com o nome de sua aplica<63><61>o. N<>s colocaremos nossos
|
||||
diret<65>rios do Smarty dentro de
|
||||
"/web/www.mydomain.com/smarty/guestbook/".
|
||||
<filename class="directory">"/web/www.mydomain.com/smarty/guestbook/"</filename>.
|
||||
</para>
|
||||
<para>
|
||||
Voc<6F> precisar<61> pelo menos de um arquivo dentro de seu 'document root', e que seja acessado pelo
|
||||
navegador. N<>s chamamos nosso
|
||||
script de "index.php", e o colocamos em um subdiret<65>rio dentro
|
||||
do 'document root' chamado "/guestbook/".
|
||||
script de <emphasis>"index.php"</emphasis>, e o colocamos em um subdiret<65>rio dentro
|
||||
do 'document root' chamado <filename class="directory">"/guestbook/"</filename>.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
<EFBFBD> conveniente configurar o servidor de forma que "index.php" possa ser identificado
|
||||
como o <20>ndice de diret<65>rio padr<64>o, desta forma se voc<6F> acessa
|
||||
"http://www.mydomain.com/guestbook/", o script index.php ser<65> executado
|
||||
sem "index.php" na URL. No Apache voc<6F> pode definir isto adicionando
|
||||
"index.php" no final de sua configura<72><61>o
|
||||
DirectoryIndex (separe cada entrada com um espa<70>o.)
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
<EFBFBD> conveniente configurar o servidor web para que 'index.php' possa ser
|
||||
idendificado como o <20>ndice padr<EFBFBD>o do diret<65>rio, asssim se voc<6F> acessar
|
||||
http://www.example.com/guestbook/, o script 'index.php' ser<65> executado
|
||||
sem adicionar 'index.php' na URL. No Apache voc<6F> pode configurar isto adicioanando
|
||||
"index.php" ao final da sua configura<72><61>o <emphasis>DirectoryIndex</emphasis>
|
||||
(separe cada item com um espa<70>o.) como no exemplo de httpd.conf
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>DirectoryIndex
|
||||
index.htm index.html index.php index.php3 default.html index.cgi
|
||||
</emphasis>
|
||||
</para>
|
||||
</note>
|
||||
|
||||
@@ -206,40 +304,48 @@ $smarty = new Smarty;
|
||||
<example>
|
||||
<title>Exemplo de estrutura de arquivo</title>
|
||||
<screen>
|
||||
/usr/local/lib/php/Smarty/Smarty.class.php
|
||||
/usr/local/lib/php/Smarty/Smarty_Compiler.class.php
|
||||
/usr/local/lib/php/Smarty/Config_File.class.php
|
||||
/usr/local/lib/php/Smarty/debug.tpl
|
||||
/usr/local/lib/php/Smarty/core/*.php
|
||||
/usr/local/lib/php/Smarty/plugins/*.php
|
||||
<![CDATA[
|
||||
/usr/local/lib/php/Smarty-v.e.r/libs/Smarty.class.php
|
||||
/usr/local/lib/php/Smarty-v.e.r/libs/Smarty_Compiler.class.php
|
||||
/usr/local/lib/php/Smarty-v.e.r/libs/Config_File.class.php
|
||||
/usr/local/lib/php/Smarty-v.e.r/libs/debug.tpl
|
||||
/usr/local/lib/php/Smarty-v.e.r/libs/internals/*.php
|
||||
/usr/local/lib/php/Smarty-v.e.r/libs/plugins/*.php
|
||||
|
||||
/web/www.mydomain.com/smarty/guestbook/templates/
|
||||
/web/www.mydomain.com/smarty/guestbook/templates_c/
|
||||
/web/www.mydomain.com/smarty/guestbook/configs/
|
||||
/web/www.mydomain.com/smarty/guestbook/cache/
|
||||
/web/www.example.com/smarty/guestbook/templates/
|
||||
/web/www.example.com/smarty/guestbook/templates_c/
|
||||
/web/www.example.com/smarty/guestbook/configs/
|
||||
/web/www.example.com/smarty/guestbook/cache/
|
||||
|
||||
/web/www.mydomain.com/docs/guestbook/index.php
|
||||
/web/www.example.com/docs/guestbook/index.php
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
O Smarty precisar<EFBFBD> escrever para o <emphasis>$compile_dir</emphasis> e
|
||||
<emphasis>$cache_dir</emphasis>, ent<6E>o garanta que o usu<EFBFBD>rio do servidor web possa
|
||||
escrever neles. Este <20> geralmente o usu<73>rio "nobody" e o grupo "nobody" (ningu<67>m). Para
|
||||
SO com X usu<73>rios, o usu<73>rio padr<64>o <20> "www" e o grupo "www". Se voc<6F> est<73> usando Apache, voc<6F>
|
||||
pode olhar em seu arquivo httpd.conf (normalmente em "/usr/local/apache/conf/") para ver
|
||||
qual o usu<73>rio e grupo est<73>o sendo usados.
|
||||
O Smarty ir<69> precisar de <emphasis role="bold">acesso de escrita</emphasis>
|
||||
(usu<EFBFBD>rios de windows por favor ignorem) em
|
||||
<link linkend="variable.compile.dir">
|
||||
<emphasis>$compile_dir</emphasis></link> e
|
||||
<link linkend="variable.cache.dir">
|
||||
<emphasis>$cache_dir</emphasis></link>,
|
||||
ent<6E>o tenha certesa que o usu<73>rio do servidor web possa escrever.
|
||||
Este <20> geralmente o usu<73>rio "nobody" e o grupo "nobody" (ningu<67>m). Para
|
||||
SO com X usu<73>rios, o usu<73>rio padr<64>o <20> "www" e o grupo "www". Se voc<6F> est<73> usando Apache, voc<6F>
|
||||
pode olhar em seu arquivo httpd.conf (normalmente em "/usr/local/apache/conf/") para ver
|
||||
qual o usu<73>rio e grupo est<73>o sendo usados.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Configurando permiss<73>es de arquivos</title>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
chown nobody:nobody /web/www.example.com/smarty/guestbook/templates_c/
|
||||
chmod 770 /web/www.example.com/smarty/guestbook/templates_c/
|
||||
|
||||
chown nobody:nobody /web/www.mydomain.com/smarty/guestbook/templates_c/
|
||||
chmod 770 /web/www.mydomain.com/smarty/guestbook/templates_c/
|
||||
|
||||
chown nobody:nobody /web/www.mydomain.com/smarty/guestbook/cache/
|
||||
chmod 770 /web/www.mydomain.com/smarty/guestbook/cache/
|
||||
chown nobody:nobody /web/www.example.com/smarty/guestbook/cache/
|
||||
chmod 770 /web/www.example.com/smarty/guestbook/cache/
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -254,17 +360,17 @@ chmod 770 /web/www.mydomain.com/smarty/guestbook/cache/
|
||||
</note>
|
||||
|
||||
<para>
|
||||
N<>s precisamos criar o arquivo index.tpl que o Smarty vai ler. Ele estar<61> localizado em seu
|
||||
$template_dir.
|
||||
N<EFBFBD>s precisamos criar o arquivo "index.tpl" que o Smarty vai ler. Ele estar<61> localizado em seu
|
||||
<link linkend="variable.template.dir">$template_dir</link>.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Editando /web/www.mydomain.com/smarty/guestbook/templates/index.tpl</title>
|
||||
<title>Editando /web/www.example.com/smarty/guestbook/templates/index.tpl</title>
|
||||
<screen>
|
||||
|
||||
{* Smarty *}
|
||||
|
||||
Ol<EFBFBD>, {$nome}!
|
||||
Ola! {$name}, bem vindo ao Smarty!
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -272,56 +378,63 @@ Ol
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
{* Smarty *} <20> um coment<EFBFBD>rio de template. Ele n<>o <20> exigido, mas <20> uma pr<70>tica boa
|
||||
iniciar todos os seus arquivos de template com este com este coment<6E>rio. Isto faz com
|
||||
que o arquivo seja reconhecido sem levar em considera<72><61>o a sua extens<6E>o. Por exemplo,
|
||||
editores de texto poderiam reconhecer o arquivo e habilitar colora<72><61>o de sintaxe especial.
|
||||
{* Smarty *} <20> um <link linkend="language.syntax.comments">coment<EFBFBD>rio</link>
|
||||
de template. Ele n<>o <20> exigido, mas <20> uma pr<70>tica boa
|
||||
iniciar todos os seus arquivos de template com este com este coment<6E>rio. Isto faz com
|
||||
que o arquivo seja reconhecido sem levar em considera<72><61>o a sua extens<6E>o. Por exemplo,
|
||||
editores de texto poderiam reconhecer o arquivo e habilitar colora<72><61>o de sintaxe especial.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
Agora vamos editar index.php. N<>s criaremos uma inst<EFBFBD>ncia do Smarty, atribuiremos valores <20>s vari<72>veis
|
||||
de template e mostraremos o arquivo index.tpl. Em nosso ambiente de exemplo,
|
||||
"/usr/local/lib/php/Smarty" <20> o nosso include_path. Certifique-se de ter feito o mesmo, ou use
|
||||
caminhos absolutos.
|
||||
Agora vamos editar 'index.php'. N<>s vamos criar uma instancia do Smarty,
|
||||
<link linkend="api.assign">assign</link>(definir) uma
|
||||
vari<72>vel do template e <link linkend="api.display">display</link>
|
||||
(mostrar) o arquivo 'index.tpl'.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Editando /web/www.mydomain.com/docs/guestbook/index.php</title>
|
||||
<title>Editando /web/www.example.com/docs/guestbook/index.php</title>
|
||||
<screen>
|
||||
// carregar a biblioteca do Smarty
|
||||
require('Smarty.class.php');
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
// load Smarty library
|
||||
require_once(SMARTY_DIR . 'Smarty.class.php');
|
||||
|
||||
$smarty->template_dir = '/web/www.mydomain.com/smarty/guestbook/templates/';
|
||||
$smarty->compile_dir = '/web/www.mydomain.com/smarty/guestbook/templates_c/';
|
||||
$smarty->config_dir = '/web/www.mydomain.com/smarty/guestbook/configs/';
|
||||
$smarty->cache_dir = '/web/www.mydomain.com/smarty/guestbook/cache/';
|
||||
$smarty = new Smarty();
|
||||
|
||||
$smarty->assign('nome','Thomas');
|
||||
$smarty->template_dir = '/web/www.example.com/smarty/guestbook/templates/';
|
||||
$smarty->compile_dir = '/web/www.example.com/smarty/guestbook/templates_c/';
|
||||
$smarty->config_dir = '/web/www.example.com/smarty/guestbook/configs/';
|
||||
$smarty->cache_dir = '/web/www.example.com/smarty/guestbook/cache/';
|
||||
|
||||
$smarty->assign('name','Ned');
|
||||
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<note>
|
||||
<title>Nota T<>cnica</title>
|
||||
<para>
|
||||
Em nosso exemplo, n<>s estamos configurando caminhos absolutos para todos os diret<65>rios
|
||||
do Smarty. Se '/web/www.mydomain.com/smarty/guestbook/' est<73> dentro de seu include_path
|
||||
do PHP, ent<6E>o estas configura<EFBFBD><EFBFBD>es n<>o s<>o necess<73>rias. Entretanto, isto <20> mais eficiente
|
||||
e (a experi<72>ncia mostra) menos tend<6E>ncia a erros em rela<6C><61>o <20> defini<6E><69>o de caminhos
|
||||
absolutos. Isto garante que o Smarty est<73> obtendo os arquivos dos diret<65>rios que voc<6F> deseja.
|
||||
No nosso exemplo, n<>s estamos definindo caminhos absolutor para todos os diret<65>rios
|
||||
do Smarty. Se <filename class="directory">/web/www.example.com/smarty/guestbook/</filename>
|
||||
estiver dentro do seu include_path do PHP, ent<6E>o estas defini<EFBFBD><EFBFBD>es n<>o s<>o necess<73>rias.
|
||||
Entretando, <20> mais eficinte e (com experi<72>ncia) causa
|
||||
menos erros definir como caminhos absolutos. Isto faz ter certeza que o Smarty
|
||||
esta lendo os arquivos dos diret<65>rios que voc<6F> quer.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
Agora carregue o arquivo index.php em seu navegador.
|
||||
Voc<6F> veria "Ol<4F>, Thomas!"
|
||||
Agora carregue o arquivo <filename>index.php</filename> em seu navegador.
|
||||
Voc<EFBFBD> veria "Ol<4F>, Thomas! bem vindo ao Smarty"
|
||||
</para>
|
||||
<para>
|
||||
Voc<6F> completou a configura<72><61>o b<>sica para o Smarty!
|
||||
Voc<EFBFBD> completou a configura<72><61>o b<>sica para o Smarty!
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="installing.smarty.extended">
|
||||
@@ -336,7 +449,7 @@ $smarty->display('index.tpl');
|
||||
Uma forma um pouco mais flex<65>vel de configurar o Smarty <20> estender a classe e inicializar seu ambiente de
|
||||
Smarty. Ent<6E>o, ao inv<6E>s de configurar caminhos de diret<65>rios repetidamente, preencher as mesmas vari<72>veis,
|
||||
etc., n<>s podemos fazer isso para facilitar. Vamos criar um novo diret<65>rio "/php/includes/guestbook/" e criar um
|
||||
novo arquivo chamado "setup.php". Em nosso ambiente de exemplo, "/php/includes" est<73> em nosso
|
||||
novo arquivo chamado <filename>"setup.php"</filename>. Em nosso ambiente de exemplo, "/php/includes" est<73> em nosso
|
||||
include_path. Certifique-se de que voc<6F>
|
||||
tamb<6D>m definiu isto, ou use caminhos de arquivos absolutos.
|
||||
</para>
|
||||
@@ -344,33 +457,38 @@ $smarty->display('index.tpl');
|
||||
<example>
|
||||
<title>Editando /php/includes/guestbook/setup.php</title>
|
||||
<screen>
|
||||
|
||||
// carrega a biblioteca do Smarty
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Carrega a biblioteca Smarty
|
||||
require('Smarty.class.php');
|
||||
|
||||
// O arquivo setup.php <20> uma boa forma para carregar
|
||||
// arquivos de bibliotecas da aplica<63><61>o exigida, e voc<6F> pode fazer
|
||||
// isso corretamente aqui. Um exemplo:
|
||||
// O arquivo setup.php <20> um bom lugar para carregar
|
||||
// arquivos necessarios para a aplica<63><61>o e voc<6F>
|
||||
// pode faze-lo aqui mesmo. Um exemplo:
|
||||
// require('guestbook/guestbook.lib.php');
|
||||
|
||||
class Smarty_GuestBook extends Smarty {
|
||||
|
||||
function Smarty_GuestBook() {
|
||||
|
||||
// Construtor da Classe. Estes automaticamente s<>o definidos a cada nova inst<73>ncia.
|
||||
function Smarty_GuestBook()
|
||||
{
|
||||
|
||||
$this->Smarty();
|
||||
// Construtor da classe.
|
||||
// Este <20> chamado a cada nova inst<73>ncia.
|
||||
|
||||
$this->template_dir = '/web/www.mydomain.com/smarty/guestbook/templates/';
|
||||
$this->compile_dir = '/web/www.mydomain.com/smarty/guestbook/templates_c/';
|
||||
$this->config_dir = '/web/www.mydomain.com/smarty/guestbook/configs/';
|
||||
$this->cache_dir = '/web/www.mydomain.com/smarty/guestbook/cache/';
|
||||
|
||||
$this->caching = true;
|
||||
$this->assign('app_name','Guest Book');
|
||||
}
|
||||
$this->Smarty();
|
||||
|
||||
$this->template_dir = '/web/www.example.com/smarty/guestbook/templates/';
|
||||
$this->compile_dir = '/web/www.example.com/smarty/guestbook/templates_c/';
|
||||
$this->config_dir = '/web/www.example.com/smarty/guestbook/configs/';
|
||||
$this->cache_dir = '/web/www.example.com/smarty/guestbook/cache/';
|
||||
|
||||
$this->caching = true;
|
||||
$this->assign('app_name', 'Guest Book');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -379,7 +497,7 @@ class Smarty_GuestBook extends Smarty {
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Editando /web/www.mydomain.com/docs/guestbook/index.php</title>
|
||||
<title>Editando /web/www.example.com/docs/guestbook/index.php</title>
|
||||
<screen>
|
||||
|
||||
require('guestbook/setup.php');
|
||||
|
@@ -0,0 +1,28 @@
|
||||
<!-- EN-Revision: 1.5 Maintainer: fernandoc Status: ready -->
|
||||
|
||||
<!ENTITY note.parameter.merge '<note>
|
||||
<title>Nota tecnica</title>
|
||||
<para>
|
||||
O par<61>metro <parameter>merge</parameter> respeita as chaves de matrizes, assim se
|
||||
voc<6F> combinar duas matrizes com <20>ndices n<>mericos, elas devem se sobrescrever
|
||||
ou resultar em chaves n<>o sequenciais. Isto <20> diferente da fun<75><6E>o
|
||||
<ulink url="&url.php-manual;array_merge">array_merge()</ulink>
|
||||
do PHP o qual elimina os <20>ndices n<>meros e colocas os n<>meros novamente.
|
||||
</para>
|
||||
</note>'>
|
||||
|
||||
<!ENTITY parameter.compileid '<para>
|
||||
Como o terceiro par<61>metro opcional, voc<6F> pode passar
|
||||
<parameter>$compile_id</parameter>.
|
||||
Isto <20> no caso de voc<6F> querer compilar diferentes vers<72>es do mesmo
|
||||
template, como ter templates separados compilados para
|
||||
l<>nguas diferentes. Outro uso para
|
||||
<parameter>$compile_id</parameter> <20> quando voc<6F> for usar mais de um
|
||||
<link linkend="variable.template.dir">$template_dir</link>
|
||||
mas apenas um <link linkend="variable.compile.dir">$compile_dir</link>.
|
||||
Defina um <parameter>$compile_id</parameter> separado para cada
|
||||
<link linkend="variable.template.dir">$template_dir</link>, se n<>o
|
||||
templates com o mesmo nome ir<69>o se sobrescrever. Voc<6F> pode
|
||||
tamb<6D>m definir a vari<72>vel <link linkend="variable.compile.id">$compile_id</link>
|
||||
ao inv<6E>s de passar isto a cada chamada desta fun<75><6E>o.
|
||||
</para>'>
|
@@ -25,9 +25,9 @@ COLSPAN="3" ALIGN="center"> </TD></TR></TABLE></TD></TR><TR BGCOLOR="#33336
|
||||
<DIV CLASS="author">Taniel Franklin</DIV>
|
||||
<DIV CLASS="author">Thomas Gonzalez Miranda</DIV>
|
||||
</TD></TR></TABLE>
|
||||
<BR><P ALIGN="CENTER">Este ficheiro foi gerado em: [GENTIME]<BR>
|
||||
<BR><P ALIGN="CENTER">Este arquivo foi gerado em: [GENTIME]<BR>
|
||||
Clique em <A HREF="http://smarty.php.net/download-docs.php">http://smarty.php.net/download-docs.php</A>
|
||||
para obter a vers<72>o actual.</P>
|
||||
para obter a vers<72>o atual.</P>
|
||||
|
||||
<BR><P CLASS="copyright" ALIGN="CENTER">Copyright © 2001 - 2005 New Digital Group, Inc.</P>
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- PTBR-Revision: 1.4 Maintainer: thomasgm Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: thomasgm Status: ready -->
|
||||
<preface id="preface">
|
||||
<title>Pref<EFBFBD>cio</title>
|
||||
<para>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<chapter id="advanced.features">
|
||||
<title>Advanced Features</title>
|
||||
&programmers.advanced-features.advanced-features-objects;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.objects">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="advanced.features.objects">
|
||||
<title>Objetos</title>
|
||||
<para>
|
||||
O Smarty permite acesso a objetos do PHP atrav<61>s de seus templates. H<> duas formas de acess<73>-los.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.outputfilters">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="advanced.features.outputfilters">
|
||||
<title>Output Filters (Filtros de Sa<53>da)</title>
|
||||
<para>
|
||||
Quando o template <20> invocado via display() ou fetch(), sua sa<73>da pode ser enviada
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.postfilters">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="advanced.features.postfilters">
|
||||
<title>Postfilters</title>
|
||||
<para>
|
||||
Os postfilters de template s<>o fun<75><6E>es de PHP nas quais seus templates s<>o rodados
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="advanced.features.prefilters">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="advanced.features.prefilters">
|
||||
<title>Prefilters</title>
|
||||
<para>
|
||||
Os prefilters de Template s<>o fun<75><6E>es de PHP nas quais seus templates s<>o rodados
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="section.template.cache.handler.func">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="section.template.cache.handler.func">
|
||||
<title>Fun<EFBFBD><EFBFBD>o Manipuladora de Cache</title>
|
||||
<para>
|
||||
Como uma alternativa ao uso do mecanismo de caching padr<64>o baseado em arquivo, voc<6F> pode
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="template.resources">
|
||||
<title>Recursos (Resources)</title>
|
||||
<para>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="api.functions">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<chapter id="api.functions">
|
||||
<title>M<EFBFBD>todos</title>
|
||||
&programmers.api-functions.api-append;
|
||||
&programmers.api-functions.api-append-by-ref;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.append.by.ref">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.append.by.ref">
|
||||
<title>append_by_ref</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.append">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.append">
|
||||
<title>append</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.assign.by.ref">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.assign.by.ref">
|
||||
<title>assign_by_ref</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.assign">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.assign">
|
||||
<title>assign</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.clear.all.assign">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.clear.all.assign">
|
||||
<title>clear_all_assign</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.clear.all.cache">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.clear.all.cache">
|
||||
<title>clear_all_cache</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.clear.assign">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.clear.assign">
|
||||
<title>clear_assign</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.clear.cache">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.clear.cache">
|
||||
<title>clear_cache</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_cache</methodname>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.clear.compiled.tpl">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.clear.compiled.tpl">
|
||||
<title>clear_compiled_tpl</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.clear.config">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.clear.config">
|
||||
<title>clear_config</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_config</methodname>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.config.load">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.config.load">
|
||||
<title>config_load</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>config_load</methodname>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.display">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.display">
|
||||
<title>display</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>display</methodname>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.fetch">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.fetch">
|
||||
<title>fetch</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fetch</methodname>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.get.config.vars">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.get.config.vars">
|
||||
<title>get_config_vars</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_config_vars</methodname>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.get.registered.object">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.get.registered.object">
|
||||
<title>get_registered_object</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.get.template.vars">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.get.template.vars">
|
||||
<title>get_template_vars</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_template_vars</methodname>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.is.cached">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.is.cached">
|
||||
<title>is_cached</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.load.filter">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.load.filter">
|
||||
<title>load_filter</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.block">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.block">
|
||||
<title>register_block</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.compiler.function">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.compiler.function">
|
||||
<title>register_compiler_function</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.function">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.function">
|
||||
<title>register_function</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.modifier">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.modifier">
|
||||
<title>register_modifier</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.object">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.object">
|
||||
<title>register_object</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.outputfilter">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.outputfilter">
|
||||
<title>register_outputfilter</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.postfilter">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.postfilter">
|
||||
<title>register_postfilter</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.prefilter">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.prefilter">
|
||||
<title>register_prefilter</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.register.resource">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.register.resource">
|
||||
<title>register_resource</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.template.exists">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.template.exists">
|
||||
<title>template_exists</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.trigger.error">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.trigger.error">
|
||||
<title>trigger_error</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.block">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.block">
|
||||
<title>unregister_block</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.compiler.function">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.compiler.function">
|
||||
<title>unregister_compiler_function</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.function">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.function">
|
||||
<title>unregister_function</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.modifier">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.modifier">
|
||||
<title>unregister_modifier</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.object">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.object">
|
||||
<title>unregister_object</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.outputfilter">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.outputfilter">
|
||||
<title>unregister_outputfilter</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.postfilter">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.postfilter">
|
||||
<title>unregister_postfilter</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="api.unregister.prefilter">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.prefilter">
|
||||
<title>unregister_prefilter</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="api.unregister.resource">
|
||||
<title>unregister_resource</title>
|
||||
<funcsynopsis>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<chapter id="api.variables">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<chapter id="api.variables">
|
||||
<title>Vari<EFBFBD>veis</title>
|
||||
|
||||
&programmers.api-variables.variable-template-dir;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.autoload.filters">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.autoload.filters">
|
||||
<title>$autoload_filters</title>
|
||||
<para>
|
||||
Se h<> algum filtro que voc<6F> deseja carregar em cada chamada de template,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.dir">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.cache.dir">
|
||||
<title>$cache_dir</title>
|
||||
<para>
|
||||
Isso <20> o nome do diret<65>rio onde os caches do template s<>o
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.handler.func">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.cache.handler.func">
|
||||
<title>$cache_handler_func</title>
|
||||
<para>
|
||||
Voc<6F> pode fornecer uma fun<75><6E>o padr<64>o para manipular arquivos de cache ao inv<6E>s de
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.lifetime">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.cache.lifetime">
|
||||
<title>$cache_lifetime</title>
|
||||
<para>
|
||||
Isso <20> o comprimento de tempo em segundos que um cache de template <20> v<>lido.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.cache.modified.check">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.cache.modified.check">
|
||||
<title>$cache_modified_check</title>
|
||||
<para>
|
||||
Se configurado para true, Smarty ir<69> respeitar o If-Modified-Since
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.caching">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.caching">
|
||||
<title>$caching</title>
|
||||
<para>
|
||||
Isto diz <20> Smarty se h<> ou n<>o sa<73>da de cache para o template.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compile.check">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.compile.check">
|
||||
<title>$compile_check</title>
|
||||
<para>
|
||||
Em cima de cada requisi<73><69>o da aplica<63><61>o PHP , Smarty testa para ver se o
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compile.dir">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.compile.dir">
|
||||
<title>$compile_dir</title>
|
||||
<para>
|
||||
Esse <20> o nome do diret<65>rio onde os template compilados est<73>o localizados
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compile.id">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.compile.id">
|
||||
<title>$compile_id</title>
|
||||
<para>
|
||||
Identificador de compila<6C><61>o persistente. Como uma alternativa
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.compiler.class">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.compiler.class">
|
||||
<title>$compiler_class</title>
|
||||
<para>
|
||||
Especifica o nome do compilador de classes que
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.booleanize">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.config.booleanize">
|
||||
<title>$config_booleanize</title>
|
||||
<para>
|
||||
Se setado para true, os valores do arquivo de configura<72><61>o de on/true/yes e off/false/no
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.dir">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.config.dir">
|
||||
<title>$config_dir</title>
|
||||
<para>
|
||||
Este <20> o diret<65>rio usado para armazenar arquivos de configura<72><61>o usados nos
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.fix.newlines">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.config.fix.newlines">
|
||||
<title>$config_fix_newlines</title>
|
||||
<para>
|
||||
Se setado para true, mac e dos newlines (\r e \r\n) no arquivo de configura<72><61>o ser<65>o
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.overwrite">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.config.overwrite">
|
||||
<title>$config_overwrite</title>
|
||||
<para>
|
||||
Se configurado para true, vari<72>veis lidas no arquivo de configura<72><61>es ir<69>o sobrescrever
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.read.hidden">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.config.read.hidden">
|
||||
<title>$config_read_hidden</title>
|
||||
<para>
|
||||
Se configurado para true, esconde se<73><65>es (nomes de se<73><65>es come<6D>ados com um per<65>odo)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.debug.tpl">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.debug.tpl">
|
||||
<title>$debug_tpl</title>
|
||||
<para>
|
||||
Este <20> o nome do arquivo de template usado para o console de debug.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.debugging.ctrl">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.debugging.ctrl">
|
||||
<title>$debugging_ctrl</title>
|
||||
<para>
|
||||
Isso permite caminhos alternativos de habilitar o debug. NONE n<>o significa
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.debugging">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.debugging">
|
||||
<title>$debugging</title>
|
||||
<para>
|
||||
Isso habilita o <link
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.default.modifiers">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.default.modifiers">
|
||||
<title>$default_modifiers</title>
|
||||
<para>
|
||||
Isso <20> um array de modificadores implicitamente aplicados par cada
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.default.resource.type">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.default.resource.type">
|
||||
<title>$default_resource_type</title>
|
||||
<para>
|
||||
Isso diz <20> Smarty qual tipo de recurso usar implicitamente.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.default.template.handler.func">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.default.template.handler.func">
|
||||
<title>$default_template_handler_func</title>
|
||||
<para>
|
||||
Essa fun<75><6E>o <20> chamada quando um template n<>o pode ser obtido
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.force.compile">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.force.compile">
|
||||
<title>$force_compile</title>
|
||||
<para>
|
||||
Isso for<6F>a Smarty para (re)compilar templates a cada requisi<73><69>o.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.global.assign">
|
||||
<!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->
|
||||
<sect1 id="variable.global.assign">
|
||||
<title>$global_assign</title>
|
||||
<para>
|
||||
Essa <20> a lista de vari<72>veis que est<73>o sempre implicitamente fixadas
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user