<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Just is here--恰恰在这里 &#187; smarty</title>
	<atom:link href="http://ishere.cn/tag/smarty/feed" rel="self" type="application/rss+xml" />
	<link>http://ishere.cn</link>
	<description>Jena&#039;s blog</description>
	<lastBuildDate>Sat, 14 Apr 2012 07:27:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Smarty 定界符 花括号 大括号 函数定义 转义</title>
		<link>http://ishere.cn/2009/03/26/smarty-%e5%ae%9a%e7%95%8c%e7%ac%a6-%e8%8a%b1%e6%8b%ac%e5%8f%b7-%e5%a4%a7%e6%8b%ac%e5%8f%b7-%e5%87%bd%e6%95%b0%e5%ae%9a%e4%b9%89-%e8%bd%ac%e4%b9%89.html</link>
		<comments>http://ishere.cn/2009/03/26/smarty-%e5%ae%9a%e7%95%8c%e7%ac%a6-%e8%8a%b1%e6%8b%ac%e5%8f%b7-%e5%a4%a7%e6%8b%ac%e5%8f%b7-%e5%87%bd%e6%95%b0%e5%ae%9a%e4%b9%89-%e8%bd%ac%e4%b9%89.html#comments</comments>
		<pubDate>Thu, 26 Mar 2009 14:29:26 +0000</pubDate>
		<dc:creator>jena</dc:creator>
				<category><![CDATA[zf+smarty]]></category>
		<category><![CDATA[smarty]]></category>

		<guid isPermaLink="false">http://www.ishere.cn/?p=508</guid>
		<description><![CDATA[使用 Smarty 模板的时候，通常都是用 ‘{’ 和 ‘}’ 作为定界符（delimiter）。 有时，我们需要在 html 代码里输出大括号，如果在模板里直接写出来，会被 Smarty 的解析器认为是定界符，然后会报错： Smarty error : syntax error: unrecognized tag 无法识别的标签！ 如何解决呢？有 2 种办法： 1：内置变量 ldelim, rdelim ldelim and rdelim are used for displaying the literal delimiter, in our case “{” &#8230; <a href="http://ishere.cn/2009/03/26/smarty-%e5%ae%9a%e7%95%8c%e7%ac%a6-%e8%8a%b1%e6%8b%ac%e5%8f%b7-%e5%a4%a7%e6%8b%ac%e5%8f%b7-%e5%87%bd%e6%95%b0%e5%ae%9a%e4%b9%89-%e8%bd%ac%e4%b9%89.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="entry clear">
<p>使用 Smarty 模板的时候，通常都是用 ‘{’ 和 ‘}’ 作为定界符（delimiter）。</p>
<p>有时，我们需要在 html 代码里输出大括号，如果在模板里直接写出来，会被 Smarty 的解析器认为是定界符，然后会报错：</p>
<div class="hl-surround">
<div class="hl-main"><span style="color: gray;">Smarty error : syntax error: unrecognized tag</span></div>
</div>
<p>无法识别的标签！</p>
<p>如何解决呢？有 2 种办法：</p>
<p>1：内置变量</p>
<div class="hl-surround">
<div class="hl-main"><span style="color: gray;">ldelim, rdelim<br />
ldelim and rdelim are used for displaying the literal delimiter, in our case “{” or “}”. The template engine always tries to interpret delimiters, so this is the way around that.</span></div>
</div>
<p>ldelim 和 rdelim 用于输出分隔符，也就是大括号 ‘{’ 和 ‘}’。如果只是输出很少的几个大括号，请使用此方法。</p>
<p>2： 文本转义</p>
<p>我们经常会在 html 里写  javascript  函数，就不可避免地写大量的大括号，这个时候上面的解决方法就不适用了，Smarty  提供了一个转义一段代码的标签：{literal}…{/literal}</p>
<div class="hl-surround">
<div class="hl-main">{literal}<br />
&lt;script type=”text/javascript”&gt;<br />
function sayHello() {alert(&#8216;Hello World!&#8217;)}<br />
&lt;/script&gt;<br />
{/literal}</div>
</div>
<p>这样，就可以在里面随意写各种符号，不必担心 Smarty 引擎会错误解析了！</p></div>
]]></content:encoded>
			<wfw:commentRss>http://ishere.cn/2009/03/26/smarty-%e5%ae%9a%e7%95%8c%e7%ac%a6-%e8%8a%b1%e6%8b%ac%e5%8f%b7-%e5%a4%a7%e6%8b%ac%e5%8f%b7-%e5%87%bd%e6%95%b0%e5%ae%9a%e4%b9%89-%e8%bd%ac%e4%b9%89.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

