参数名称 类型 必选参数 默认值 说明
file string Yes n/a 获取的文件名、HTTP或者FTP网址
assign string No n/a 用于赋值的变量名

Example 8.5. {fetch} 例子

{* include some javascript in your template *}
{fetch file=/export/httpd/}

{* embed some weather text in your template from another web site *}
{fetch file=}

{* fetch a news headline file via ftp *}
{fetch file=}
{* as above but with variables *}
{fetch file="ftp://`$user`:`$password`@`$server`/`$path`"}

{* assign the fetched contents to a template variable *}
{fetch file= assign=weather}
{if $weather ne }
  <div id="weather">{$weather}</div>


参见 {capture}, {eval}, {assign}fetch().


XML 地图 | Sitemap 地图