mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
more tweaks
This commit is contained in:
@@ -40,6 +40,7 @@ $smarty = new Smarty;
|
|||||||
$smarty->left_delimiter = '<!--{';
|
$smarty->left_delimiter = '<!--{';
|
||||||
$smarty->right_delimiter = '}-->';
|
$smarty->right_delimiter = '}-->';
|
||||||
$smarty->assign('foo', 'bar');
|
$smarty->assign('foo', 'bar');
|
||||||
|
$smarty->assign('name', 'Albert');
|
||||||
$smarty->display('example.tpl');
|
$smarty->display('example.tpl');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -50,6 +51,7 @@ $smarty->display('example.tpl');
|
|||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
Welcome <!--{$name}--> to Smarty
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
var foo = <!--{$foo}-->;
|
var foo = <!--{$foo}-->;
|
||||||
function dosomething() {
|
function dosomething() {
|
||||||
|
@@ -11,8 +11,9 @@
|
|||||||
should not be in quotes.
|
should not be in quotes.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Some attributes require boolean values (true or false). These can be
|
Some attributes require boolean values (true or false). These
|
||||||
specified as either unquoted <literal>true</literal>,
|
<link linkend="variable.config.booleanize">can be specified</link>
|
||||||
|
as either unquoted <literal>true</literal>,
|
||||||
<literal>on</literal>, and <literal>yes</literal>, or
|
<literal>on</literal>, and <literal>yes</literal>, or
|
||||||
<literal>false</literal>, <literal>off</literal>, and
|
<literal>false</literal>, <literal>off</literal>, and
|
||||||
<literal>no</literal>.
|
<literal>no</literal>.
|
||||||
|
@@ -6,10 +6,10 @@
|
|||||||
Template comments are surrounded by asterisks, and that is surrounded
|
Template comments are surrounded by asterisks, and that is surrounded
|
||||||
by the
|
by the
|
||||||
<link linkend="variable.left.delimiter"> delimiter</link>
|
<link linkend="variable.left.delimiter"> delimiter</link>
|
||||||
tags like so: {* this is a comment *}
|
tags like so: <emphasis>{* this is a comment *}</emphasis>
|
||||||
Smarty comments are NOT displayed in the final output of the template,
|
Smarty comments are NOT displayed in the final output of the template,
|
||||||
unlike <!-- HTML comments -->
|
unlike <!-- HTML comments -->
|
||||||
They are useful for making internal notes in the templates.
|
and are useful for making internal notes in the templates.
|
||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>Comments</title>
|
<title>Comments</title>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
*}
|
*}
|
||||||
|
|
||||||
{* include the header file here *}
|
{* include the header file here *}
|
||||||
{include file="header.tpl"}
|
{include file='header.tpl'}
|
||||||
|
|
||||||
|
|
||||||
{* Dev note: $includeFile is assigned in foo.php script *}
|
{* Dev note: $includeFile is assigned in foo.php script *}
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
{html_options options=$vals selected=$selected_id}
|
{html_options options=$vals selected=$selected_id}
|
||||||
</select>
|
</select>
|
||||||
*}
|
*}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@@ -8,7 +8,8 @@
|
|||||||
<link linkend="language.syntax.variables">variables</link>
|
<link linkend="language.syntax.variables">variables</link>
|
||||||
embedded in double quotes so long as the variable name contains only numbers,
|
embedded in double quotes so long as the variable name contains only numbers,
|
||||||
letters, underscores and brackets []. With any other characters (period,
|
letters, underscores and brackets []. With any other characters (period,
|
||||||
object reference, etc.) the variable must be surrounded by backticks. You
|
object reference, etc.) the variable must be surrounded by
|
||||||
|
<link linkend="language.syntax.quotes">backticks</link>. You
|
||||||
cannot embed
|
cannot embed
|
||||||
<link linkend="language.modifiers">modifiers</link>,
|
<link linkend="language.modifiers">modifiers</link>,
|
||||||
they must always be applied outside of quotes.
|
they must always be applied outside of quotes.
|
||||||
|
Reference in New Issue
Block a user