mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-11 17:43:50 +01:00
56 lines
1.7 KiB
XML
56 lines
1.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<sect1 id="language.syntax.functions">
|
|
<title>Funções</title>
|
|
<para>
|
|
Cada tag Smarty mostra uma
|
|
<link linkend="language.variables">variável</link> ou utiliza algum tipo de
|
|
função. Funções são processadas e mostradas colocando-se a função e seus
|
|
atributos entre delimitadores, assim: {funcname
|
|
attr1="val" attr2="val"}.
|
|
</para>
|
|
<example>
|
|
<title>Sintaxe de funções</title>
|
|
<programlisting>
|
|
{config_load file="colors.conf"}
|
|
|
|
{include file="header.tpl"}
|
|
|
|
{if $highlight_name}
|
|
Welcome, <font color="{#fontColor#}">{$name}!</font>
|
|
{else}
|
|
Welcome, {$name}!
|
|
{/if}
|
|
|
|
{include file="footer.tpl"}</programlisting>
|
|
</example>
|
|
<para>
|
|
Ambas as funções internas e as funções customizadas tem a mesma sintaxe nos
|
|
templates. Funções internas são o funcionamento do Smarty,
|
|
assim como <command>if</command>, <command>section</command> e
|
|
<command>strip</command>. Elas não podem ser modificadas. Funções customizadas
|
|
são funções adicionais implementadas por plugins. Elas podem ser modificadas
|
|
como você quiser, ou você pode adionar novas. <command>html_options</command> e
|
|
<command>html_select_date</command> são exemplos de funções customizadas.
|
|
</para>
|
|
</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
|
|
--> |