{fetch}
鐢ㄤ簬鑾峰彇鏂囦欢鍐呭銆丠TTP鎴栬匜TP鍐呭锛屼互渚胯緭鍑恒
-
濡傛灉鎻愪緵鐨勬枃浠跺悕鏄互
http://
寮澶达紝閭d箞缃戠珯鐨勫唴瀹瑰皢琚幏鍙栧苟鏄剧ず銆Note
璇ュ嚱鏁颁笉鏀寔鐩存帴鐨凥TTP璁块棶锛岃纭缃戦〉鐨勫湴鍧鏄互鏂滄潬缁撳熬銆
濡傛灉鏂囦欢鍚嶆槸浠
ftp://
寮澶达紝閭d箞鏂囦欢浼氳浠嶧TP涓笅杞藉苟鏄剧ず銆-
鏈湴鏂囦欢鑰岃█锛屽彲浠ヤ娇鐢ㄧ粷瀵硅矾寰勭殑鏂囦欢锛屾垨鑰呯浉瀵逛簬褰撳墠鎵ц鐨凱HP鑴氭湰鐨勮矾寰勬枃浠跺潎鍙
Note
濡傛灉寮鍚簡瀹夊叏鏈哄埗锛岄偅涔堜粠鏈湴鑾峰彇鏂囦欢鍐呭锛
{fetch}
鍑芥暟浠呰兘璇诲彇鍦$secure_dir
瀹夊叏鐩綍涓嬬殑鏂囦欢銆 鍙傝瀹夊叏鏈哄埗銆 濡傛灉浣犳彁渚涗簡
assign
灞炴э紝{fetch}
鍑芥暟鐨勮緭鍑哄皢涓嶄細鏄剧ず锛岃屾槸璧嬪肩粰妯℃澘鍙橀噺銆
鍙傛暟鍚嶇О | 绫诲瀷 | 蹇呴夊弬鏁 | 榛樿鍊 | 璇存槑 |
---|---|---|---|---|
file | string | Yes | n/a | 鑾峰彇鐨勬枃浠跺悕銆丠TTP鎴栬匜TP缃戝潃 |
assign | string | No | n/a | 鐢ㄤ簬璧嬪肩殑鍙橀噺鍚 |
Example聽8.5.聽{fetch} 渚嬪瓙
{* include some javascript in your template *} {fetch file='/export/httpd/www.example.com/docs/navbar.js'} {* embed some weather text in your template from another web site *} {fetch file='http://www.myweather.com/68502/'} {* fetch a news headline file via ftp *} {fetch file='ftp://user:password@ftp.example.com/path/to/currentheadlines.txt'} {* as above but with variables *} {fetch file="ftp://`$user`:`$password`@`$server`/`$path`"} {* assign the fetched contents to a template variable *} {fetch file='http://www.myweather.com/68502/' assign='weather'} {if $weather ne ''} <div id="weather">{$weather}</div> {/if}