2004-04-13 08:46:28 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2004-10-03 09:04:23 +00:00
|
|
|
|
<!-- EN-Revision: 1.1 Maintainer: thomasgm Status: ready -->
|
2004-04-13 08:46:28 +00:00
|
|
|
|
<sect1 id="language.function.include">
|
|
|
|
|
|
<title>include</title>
|
|
|
|
|
|
<informaltable frame="all">
|
|
|
|
|
|
<tgroup cols="5">
|
|
|
|
|
|
<colspec colname="param" align="center" />
|
|
|
|
|
|
<colspec colname="type" align="center" />
|
|
|
|
|
|
<colspec colname="required" align="center" />
|
|
|
|
|
|
<colspec colname="default" align="center" />
|
|
|
|
|
|
<colspec colname="desc" />
|
|
|
|
|
|
<thead>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>Nome do Atributo</entry>
|
|
|
|
|
|
<entry>Tipo</entry>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
<entry>Obrigat<EFBFBD>rio</entry>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
<entry>Padr<EFBFBD>o</entry>
|
|
|
|
|
|
<entry>Descri<EFBFBD><EFBFBD>o</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>file</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>Sim</entry>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
<entry><emphasis>n/d</emphasis></entry>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
<entry>O nome do arquivo de template a incluir</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>assign</entry>
|
|
|
|
|
|
<entry>string</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
<entry><emphasis>n/d</emphasis></entry>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
<entry>O nome de uma vari<72>vel que ir<69>
|
|
|
|
|
|
conter toda a sa<73>da do template</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
<row>
|
|
|
|
|
|
<entry>[var ...]</entry>
|
|
|
|
|
|
<entry>[var type]</entry>
|
|
|
|
|
|
<entry>N<EFBFBD>o</entry>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
<entry><emphasis>n/d</emphasis></entry>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
<entry>Vari<EFBFBD>vel para passar localmente para o template</entry>
|
|
|
|
|
|
</row>
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
</tgroup>
|
|
|
|
|
|
</informaltable>
|
|
|
|
|
|
<para>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
Tags include s<>o usadas para incluir outros templates no template
|
|
|
|
|
|
atual. Quaisquer vari<72>veis dispon<6F>veis no template atual tamb<6D>m estar<61>o
|
|
|
|
|
|
dispon<6F>veis junto com template inclu<6C>do. A tag include deve ter o atributo
|
2004-04-13 08:46:28 +00:00
|
|
|
|
"file", o qual cont<6E>m o caminho do arquivo a incluir.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Voc<6F> pode opcionalmente passar o atributo <emphasis>assign</emphasis>,
|
|
|
|
|
|
o qual ir<69> especificar o nome de uma vari<72>vel de template para a qual
|
2004-09-22 14:57:20 +00:00
|
|
|
|
conter<65> todo o conte<74>do do <emphasis>include</emphasis> ao
|
|
|
|
|
|
inv<6E>s de mostr<74>-lo.
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>function include</title>
|
|
|
|
|
|
<programlisting>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
<![CDATA[
|
|
|
|
|
|
{include file="cabecalho.tpl"}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{* O conte<74>do do template vem aqui *}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{include file="rodape.tpl"}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</example>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Voc<6F> pode tamb<6D>m passar vari<72>veis para o template inclu<6C>do como atributos.
|
|
|
|
|
|
Quaisquer vari<72>veis passadas para um template inclu<6C>do como atributos
|
|
|
|
|
|
est<73>o dispon<6F>veis somente dentro do escopo do template inclu<6C>do.
|
|
|
|
|
|
As vari<72>veis passadas como atributos sobrescrevem as vari<72>veis de
|
|
|
|
|
|
template atuais, no caso de ambas terem o mesmo nome.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>Fun<EFBFBD><EFBFBD>o include passando vari<72>veis</title>
|
|
|
|
|
|
<programlisting>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
<![CDATA[
|
|
|
|
|
|
{include file="cabecalho.tpl" title="Menu Principal" table_bgcolor="#c0c0c0"}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{* O conte<74>do de template vem aqui *}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{include file="rodape.tpl" logo="http://meu.dominio.com/logo.gif"}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</example>
|
|
|
|
|
|
<para>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
Use a sintaxe de <link
|
2004-04-13 08:46:28 +00:00
|
|
|
|
linkend="template.resources">template resources</link> para
|
|
|
|
|
|
incluir arquivos fora do diret<65>rio $template_dir.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>Exemplos de recursos para a fun<75><6E>o include</title>
|
|
|
|
|
|
<programlisting>
|
2004-09-22 14:57:20 +00:00
|
|
|
|
<![CDATA[
|
2004-04-13 08:46:28 +00:00
|
|
|
|
{* caminho absoluto *}
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{include file="/usr/local/include/templates/cabecalho.tpl"}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{* caminho absoluto (idem) *}
|
|
|
|
|
|
{include file="file:/usr/local/include/templates/cabecalho.tpl"}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
|
|
|
|
|
{* caminho absoluto do windows (DEVE usar o prefixo "file:") *}
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{include file="file:C:/www/pub/templates/cabecalho.tpl"}
|
2004-04-13 08:46:28 +00:00
|
|
|
|
|
|
|
|
|
|
{* incluir a partir do recurso de template chamado "db" *}
|
2004-09-22 14:57:20 +00:00
|
|
|
|
{include file="db:header.tpl"}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
2004-04-13 08:46:28 +00:00
|
|
|
|
</example>
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
|
|
Local variables:
|
|
|
|
|
|
mode: sgml
|
|
|
|
|
|
sgml-omittag:t
|
|
|
|
|
|
sgml-shorttag:t
|
|
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
|
|
sgml-indent-step:1
|
|
|
|
|
|
sgml-indent-data:t
|
|
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
|
|
sgml-parent-document:nil
|
|
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
|
|
End:
|
|
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
|
|
-->
|