我们在任何地方显示当前页面的链接。
方便用于块“共享”
网站上没有负载,只显示一个标签..
打开engine / modules / main.php文件并查找:
<span class="variable">$tpl</span>->result[<span class="string">'main'</span>] = str_ireplace( <span class="string">'/templates/FDv2'</span>, <span class="variable">$config</span>[<span class="string">'http_home_url'</span>] . <span class="string">'templates/'</span> . <span class="variable">$config</span>[<span class="string">'skin'</span>], <span class="variable">$tpl</span>->result[<span class="string">'main'</span>] );
下面我们添加:
<span class="variable">$tpl</span>->result[<span class="string">'main'</span>] = str_ireplace( <span class="string">'{page-url}'</span>, <span class="string">'http://'</span>.<span class="variable">$_SERVER</span>[<span class="string">'HTTP_HOST'</span>].<span class="variable">$_SERVER</span>[<span class="string">'REQUEST_URI'</span>].<span class="string">''</span>, <span class="variable">$tpl</span>->result[<span class="string">'main'</span>] );
现在{page-url}标签可用。