免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1908 | 回复: 6
打印 上一主题 下一主题

[求助]关于HTML::Template [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-02 17:02 |只看该作者 |倒序浏览
有谁见过模版里的这种标签<tmpl_var SmallImage/URL>是什么意思~~
知道的帮忙解释一下,谢谢了~

论坛徽章:
0
2 [报告]
发表于 2006-03-02 17:28 |只看该作者
原帖由 chshyu 于 2006-3-2 17:02 发表
<tmpl_var SmallImage/URL>


This is tag(or special code) which defined by this module HTML::Template.
It's very clear explained in perldoc HTML::Template.

Those web-templates technology used such as python's module:simpletal

Best, ulmer

论坛徽章:
0
3 [报告]
发表于 2006-03-02 17:41 |只看该作者
我知道它是标签<tmpl_var amazon>这样很好理解
<tmpl_var SmallImage/URL>是指目录还是什么

论坛徽章:
0
4 [报告]
发表于 2006-03-02 17:55 |只看该作者

回复 2楼 ulmer 的帖子

Just cut from perldoc HTML::Template.

>>>>>
NOTES
    HTML::Template's tags are meant to mimic normal HTML tags.  
    However, they are allowed to "break the rules".  
    Something like:
      <img src="<TMPL_VAR IMAGE_SRC>">
    is not really valid HTML, but it is a perfectly valid use and
    will work as planned.

    The "NAME=" in the tag is optional, although for extensibility's
    sake I recommend using it.  Example - "<TMPL_LOOP LOOP_NAME>" is
    acceptable.
<<<<

论坛徽章:
0
5 [报告]
发表于 2006-03-02 18:02 |只看该作者
我的问题是SmallImage/URL表示的什么意思,她不是像普通的变量amazon这样,SmallImage/URL是目录还是变量相除,基本排除是变量相除,因为程序里没有这两个变量。

论坛徽章:
0
6 [报告]
发表于 2006-03-02 19:11 |只看该作者
原帖由 chshyu 于 2006-3-2 18:02 发表
我的问题是SmallImage/URL表示的什么意思,


Here "SmallImage/URL" is 变量名! Just like the key's name from a hash!

For example:
~$ vim test.tmp:
Smile at <TMPL_VAR SmallImage/URL>

~$ vim test.pl:
use HTML::Template;
$tpl = HTML::Template->new(filename => 'test.tmp');
$tpl->param("SmallImage/URL" => "/icons/smile.gif");
$tpl->outpout;

~$ perl test.pl
Smile at /icons/smile.gif


Best, ulmer

论坛徽章:
0
7 [报告]
发表于 2006-03-02 20:12 |只看该作者
找到那个变量了,就是个变量,谢谢ulmer
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP