mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
more tweaks
This commit is contained in:
@@ -40,6 +40,7 @@ $smarty = new Smarty;
|
||||
$smarty->left_delimiter = '<!--{';
|
||||
$smarty->right_delimiter = '}-->';
|
||||
$smarty->assign('foo', 'bar');
|
||||
$smarty->assign('name', 'Albert');
|
||||
$smarty->display('example.tpl');
|
||||
|
||||
?>
|
||||
@@ -50,6 +51,7 @@ $smarty->display('example.tpl');
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Welcome <!--{$name}--> to Smarty
|
||||
<script language="javascript">
|
||||
var foo = <!--{$foo}-->;
|
||||
function dosomething() {
|
||||
|
@@ -11,8 +11,9 @@
|
||||
should not be in quotes.
|
||||
</para>
|
||||
<para>
|
||||
Some attributes require boolean values (true or false). These can be
|
||||
specified as either unquoted <literal>true</literal>,
|
||||
Some attributes require boolean values (true or false). These
|
||||
<link linkend="variable.config.booleanize">can be specified</link>
|
||||
as either unquoted <literal>true</literal>,
|
||||
<literal>on</literal>, and <literal>yes</literal>, or
|
||||
<literal>false</literal>, <literal>off</literal>, and
|
||||
<literal>no</literal>.
|
||||
|
@@ -6,10 +6,10 @@
|
||||
Template comments are surrounded by asterisks, and that is surrounded
|
||||
by the
|
||||
<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,
|
||||
unlike <!-- HTML comments -->
|
||||
They are useful for making internal notes in the templates.
|
||||
and are useful for making internal notes in the templates.
|
||||
</para>
|
||||
<example>
|
||||
<title>Comments</title>
|
||||
@@ -24,7 +24,7 @@
|
||||
*}
|
||||
|
||||
{* include the header file here *}
|
||||
{include file="header.tpl"}
|
||||
{include file='header.tpl'}
|
||||
|
||||
|
||||
{* Dev note: $includeFile is assigned in foo.php script *}
|
||||
@@ -39,6 +39,7 @@
|
||||
{html_options options=$vals selected=$selected_id}
|
||||
</select>
|
||||
*}
|
||||
|
||||
</body>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -8,7 +8,8 @@
|
||||
<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 backticks. You
|
||||
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.
|
||||
|
Reference in New Issue
Block a user