Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 3ca7e0e5486da714e98ac79af09ca745 > files > 85

php-smarty2-doc-2.6.28-2.mga4.noarch.rpm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{literal}</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<link rel="home" href="index.html" title="Smarty Manual">
<link rel="up" href="language.builtin.functions.html" title="Chapter 7. Built-in Functions">
<link rel="prev" href="language.function.ldelim.html" title="{ldelim},{rdelim}">
<link rel="next" href="language.function.php.html" title="{php}">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">{literal}</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="language.function.ldelim.html">Prev</a> </td>
<th width="60%" align="center">Chapter 7. Built-in Functions</th>
<td width="20%" align="right"> <a accesskey="n" href="language.function.php.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="{literal}">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="language.function.literal"></a>{literal}</h2></div></div></div>
<p>
  <code class="varname">{literal}</code> tags allow a block of data to be taken literally. This is typically
  used around Javascript or stylesheet blocks where {curly braces} would
  interfere with the template
  <a class="link" href="variable.left.delimiter.html" title="$left_delimiter">delimiter</a>
  syntax. Anything within
  <code class="varname">{literal}{/literal}</code> tags is not interpreted, but displayed as-is.
  If you  need template tags embedded in a <code class="varname">{literal}</code> block, consider using
  <a class="link" href="language.function.ldelim.html" title="{ldelim},{rdelim}"><code class="varname">{ldelim}{rdelim}</code></a> to escape the
  individual delimiters instead.
 </p>
<div class="example">
<a name="id3053420"></a><p class="title"><b>Example 7.25. {literal} tags</b></p>
<div class="example-contents"><pre class="programlisting">

{literal}
&lt;script type="text/javascript"&gt;
&lt;!--
  function isblank(field) {
    if (field.value == '')
      { return false; }
    else
      {
      document.loginform.submit();
      return true;
    }
  }
// --&gt;
&lt;/script&gt;
{/literal}

  </pre></div>
</div>
<br class="example-break"><div class="example">
<a name="id3053433"></a><p class="title"><b>Example 7.26. Javascript function example</b></p>
<div class="example-contents"><pre class="programlisting">

&lt;script language="JavaScript" type="text/javascript"&gt;
{literal}
function myJsFunction(name, ip){
   alert("The server name\n" + name + "\n" + ip);
}
{/literal}
&lt;/script&gt;
&lt;a href="javascript:myJsFunction('{$smarty.server.SERVER_NAME}','{$smarty.server.SERVER_ADDR}')"&gt;Click here for the Server Info&lt;/a&gt;
 
   </pre></div>
</div>
<br class="example-break"><div class="example">
<a name="id3053453"></a><p class="title"><b>Example 7.27. Some css style in a template</b></p>
<div class="example-contents"><pre class="programlisting">

{* included this style .. as an experiment *}
&lt;style type="text/css"&gt;
{literal}
/* this is an intersting idea for this section */
.madIdea{
    border: 3px outset #ffffff;
    margin: 2 3 4 5px;
    background-color: #001122;
}
{/literal}
&lt;/style&gt;
&lt;div class="madIdea"&gt;With smarty you can embed CSS in the template&lt;/div&gt;

</pre></div>
</div>
<br class="example-break"><p>
  See also
  <a class="link" href="language.function.ldelim.html" title="{ldelim},{rdelim}"><code class="varname">{ldelim} {rdelim}</code></a>
  and the
  <a class="link" href="language.escaping.html" title="Escaping Smarty Parsing">escaping Smarty parsing</a> page.
 </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="language.function.ldelim.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="language.builtin.functions.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="language.function.php.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">{ldelim},{rdelim} </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> {php}</td>
</tr>
</table>
</div>
</body>
</html>