Formatting of the basic-syntax dir

This commit is contained in:
pete_morgan
2006-09-26 02:42:08 +00:00
parent 0f7046d4d6
commit 253fd367bb
6 changed files with 65 additions and 51 deletions

View File

@@ -17,18 +17,21 @@
<para>
Including literal content is possible using <link
linkend="language.function.literal">{literal} .. {/literal}</link> blocks.
linkend="language.function.literal">
<varname>{literal}..{/literal}</varname></link> blocks.
Similar to HTML entity usage, you can use <link
linkend="language.function.ldelim">{ldelim}</link>,<link
linkend="language.function.ldelim">{rdelim}</link> or <link
linkend="language.variables.smarty.ldelim">{$smarty.ldelim}</link>
to display the current delimiters.
linkend="language.function.ldelim"><varname>{ldelim}</varname></link>,<link
linkend="language.function.ldelim"><varname>{rdelim}</varname></link> or <link
linkend="language.variables.smarty.ldelim">
<varname>{$smarty.ldelim}</varname></link> to display the current delimiters.
</para>
<para>
It is often convenient to simply change Smarty's <link
linkend="variable.left.delimiter">$left_delimiter</link> and
<link linkend="variable.right.delimiter">$right_delimiter</link>.
linkend="variable.left.delimiter">
<parameter>$left_delimiter</parameter></link> and
<link linkend="variable.right.delimiter">
<parameter>$right_delimiter</parameter></link>.
</para>
<example>
<title>changing delimiters example</title>
@@ -36,9 +39,9 @@
<![CDATA[
<?php
$smarty = new Smarty;
$smarty->left_delimiter = '<!--{';
$smarty->right_delimiter = '}-->';
$smarty->assign('foo', 'bar');
$smarty->assign('name', 'Albert');
$smarty->display('example.tpl');
@@ -47,7 +50,7 @@ $smarty->display('example.tpl');
]]>
</programlisting>
<para>
Where example.tpl is:
Where the template is:
</para>
<programlisting>
<![CDATA[
@@ -62,9 +65,6 @@ Welcome <!--{$name}--> to Smarty
]]>
</programlisting>
</example>
<para>
See also <link linkend="language.modifier.escape">escape modifier</link>
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -27,7 +27,9 @@
</example>
<para>
See also the <link linkend="language.function.math">{math}</link> function for complex equations.
See also the <link linkend="language.function.math">
<varname>{math}</varname></link> function for complex equations
and <link linkend="language.function.eval"><varname>{eval}</varname></link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -9,7 +9,7 @@
tags like so: <emphasis>{* this is a comment *}</emphasis>
Smarty comments are NOT displayed in the final output of the template,
unlike &lt;!-- HTML comments --&gt;
these are useful for making internal notes in the templates which no one will see;-).
these are useful for making internal notes in the templates which no one will see ;-)
</para>
<example>
<title>Comments within a template</title>
@@ -25,7 +25,7 @@
{* another single line smarty comment *}
<!-- HTML comment that is sent to the browser -->
{* this multiline smarty
{* this multiline smarty
comment is
not sent to browser
*}
@@ -34,10 +34,10 @@
Multi line comment block with credits block
@ author: bg@example.com
@ maintainer: support@example.com
@ para: var that sets block style
@ para: var that sets block style
@ css: the style output
**********************************************************}
{* The header file with the main logo and stuff *}
{include file='header.tpl'}
@@ -53,7 +53,7 @@ Multi line comment block with credits block
</select>
*}
{* cvs tag for a template, below the 36 SHOULD be an american currency
{* cvs tag for a template, below the 36 SHOULD be an american currency
. however its converted in cvs.. *}
{* &#36;Id: Exp &#36; *}
{* $Id: *}

View File

@@ -8,11 +8,11 @@
of function. These are processed and displayed by enclosing the
function and its
<link linkend="language.syntax.attributes">attributes</link>
within delimiters like so: {funcname
attr1='val1' attr2='val2'}.
within delimiters like so:
<literal>{funcname attr1='val1' attr2='val2'}</literal>.
</para>
<example>
<title>function syntax</title>
<title>function syntax </title>
<programlisting>
<![CDATA[
{config_load file='colors.conf'}
@@ -30,28 +30,35 @@
]]>
</programlisting>
</example>
<para>
<itemizedlist>
<listitem><para>
Both <link linkend="language.builtin.functions">built-in functions</link>
and <link linkend="language.custom.functions">custom functions</link>
have the same syntax within templates.
</para>
<para>Built-in functions are the
</para></listitem>
<listitem><para>Built-in functions are the
<emphasis role="bold">inner</emphasis> workings of Smarty, such as
<link linkend="language.function.if">{if}</link>,
<link linkend="language.function.section">{section}</link> and
<link linkend="language.function.strip">{strip}</link>.
<link linkend="language.function.if"><varname>{if}</varname></link>,
<link linkend="language.function.section"><varname>{section}</varname></link> and
<link linkend="language.function.strip"><varname>{strip}</varname></link>.
There should be no need to change or modify them.
</para>
<para>Custom functions are <emphasis role="bold">additional</emphasis>
</para></listitem>
<listitem><para>Custom functions are
<emphasis role="bold">additional</emphasis>
functions implemented via <link linkend="plugins">plugins</link>.
They can be modified to your liking, or you can create new ones.
<link linkend="language.function.html.options">{html_options}</link> and
<link linkend="language.function.popup">{popup}</link>
<link linkend="language.function.html.options">
<varname>{html_options}</varname></link> and
<link linkend="language.function.popup"><varname>{popup}</varname></link>
are examples of custom functions.
</para>
</para></listitem>
</itemizedlist>
<para>
See also <link linkend="api.register.function">register_function()</link>
See also <link linkend="api.register.function"><varname>register_function()</varname></link>
</para>
</sect1>

View File

@@ -7,12 +7,13 @@
linkend="api.assign">assigned</link>
<link linkend="language.syntax.variables">variables</link>
embedded in double quotes so long as the variable name contains only numbers,
letters, underscores and brackets []. With any other characters (period,
object reference, etc.) the variable must be surrounded by
<link linkend="language.syntax.quotes">backticks</link>. You
cannot embed
<link linkend="language.modifiers">modifiers</link>,
they must always be applied outside of quotes.
letters, underscores and brackets[]
(see <ulink url="&url.php-manual;language.variables">naming</ulink>).
With any other characters (period,
object reference, etc.) the variable must be surrounded by
`backticks`. You cannot embed
<link linkend="language.modifiers">modifiers</link>, they must always
be applied outside of quotes.
</para>
<example>
<title>embedded quotes syntax</title>
@@ -34,7 +35,7 @@ PRACTICAL EXAMPLES:
</programlisting>
</example>
<para>
See also <link linkend="language.modifier.escape">escape</link>.
See also <link linkend="language.modifier.escape"><varname>escape</varname></link>.
</para>
</sect1>

View File

@@ -13,8 +13,9 @@
<link linkend="language.config.variables">Config file variables</link>
are an exception to the $dollar syntax
and are instead referenced with surrounding #hashmarks#, or
via the
<link linkend="language.variables.smarty.config">$smarty.config</link> variable.
via the
<link linkend="language.variables.smarty.config">
<parameter>$smarty.config</parameter></link> variable.
</para>
<example>
<title>Variables</title>
@@ -46,17 +47,20 @@ Many other combinations are allowed
]]>
</programlisting>
</example>
<para>Request variables such as $_GET, $_SESSION etc are available via the <emphasis role="bold">
<link linkend="language.variables.smarty">$smarty</link></emphasis> reserved variable.
<para>Request variables such as <literal>$_GET</literal>,
<literal>$_SESSION</literal>, etc are available via the
reserved <link linkend="language.variables.smarty">
<parameter>$smarty</parameter></link> variable.
</para>
<para>
See also <link linkend="language.variables.smarty">$smarty reserved variables</link>,
<link linkend="language.config.variables">Config Variables</link>
<link linkend="language.function.assign">{assign}</link>
See also <link linkend="language.variables.smarty">
<parameter>$smarty</parameter></link>,
<link linkend="language.config.variables">config variables</link>
<link linkend="language.function.assign"><varname>{assign}</varname></link>
and
<link linkend="api.assign">assign()</link>.
<link linkend="api.assign"><varname>assign()</varname></link>.
</para>
</sect1>