0

以下のコードは、同じグローバル テンプレート変数を使用してビルド マークアップを 2 回呼び出しているため、機能しません。ビルド マークアップを修正して、ローカルの Template 変数を渡す方法はありますか?

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
4

1 に答える 1

1

'bind-markupさわやかに短い機能です。それを独自のスクリプトにコピーして、ターゲット コンテキストを渡すことができるパラメータを追加するのは比較的簡単です。

build-markup: func [
    ...
    /with scope [word! object!]
]

次に'eval、ロードされたコードが評価される関数内で、ブロックtry [do val]をに変更しtry [do bind load/all val any [:scope system/words]]ます。そうすべきだと思います。

于 2012-12-03T19:44:25.690 に答える