有什么方法可以使用绑定或其他方式纠正 Rebol 构建标记函数吗?
下面的代码不起作用,因为我在彼此内部调用构建标记两次并使用相同的全局模板变量。有什么方法可以纠正构建标记,以便我可以传递本地模板变量?
Template: {<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Free PHP Gallery - web-templates.nu</title>
<meta name="Description" content="This is a template of a free php gallery." />
<meta name="Keywords" content="template, gallery, php, free" />
<link rel="stylesheet" href="gallery/style_gallery.php" type="text/css" media="screen" />
</head>
<body>
<!-- ##### Include your gallery class and gallery between the body-tags #####
#
# To add images to your gallery, change the ADD-IMAGES.PHP
# To change the look of the gallery, change the SETTINGS.PHP
#
##### -->
<div class="gallery">
<%do %galleryview.cgi "" %>
</div>
<!-- ##### That's it, just copy and paste the line above ##### -->
</body>
</html>}
print build-markup Template
This code below doesn't work because I call build-markup two times one inside each other and using the same Global Template variable. Any way to correct build-markup so that I can pass local Template variable ?
Template: {<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Free PHP Gallery - web-templates.nu</title>
<meta name="Description" content="This is a template of a free php gallery." />
<meta name="Keywords" content="template, gallery, php, free" />
<link rel="stylesheet" href="gallery/style_gallery.php" type="text/css" media="screen" />
</head>
<body>
<!-- ##### Include your gallery class and gallery between the body-tags #####
#
# To add images to your gallery, change the ADD-IMAGES.PHP
# To change the look of the gallery, change the SETTINGS.PHP
#
##### -->
<div class="gallery">
<%do %galleryview.cgi "" %>
</div>
<!-- ##### That's it, just copy and paste the line above ##### -->
</body>
</html>}
print build-markup Template
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
'bind-markup
是一个令人耳目一新的简短函数。将其复制到您自己的脚本并添加一个允许您传递目标上下文的参数相对容易:然后在评估加载代码的
'eval
函数中,更改块尝试[do val]
到尝试[do bind load/all val any [:scope system/words]]
。我相信应该做到这一点。'bind-markup
is a refreshingly short function. It'd be relatively easy to copy it to your own script and add a parameter that would allow you to pass the target context through:Then within the
'eval
function where the loaded code is evaluated, change the blocktry [do val]
totry [do bind load/all val any [:scope system/words]]
. I believe that should do it.