cvs: smarty /docs/en/designers/language-custom-functions language-function-fetch.xml

[email protected] ("Peter 'Mash' Morgan") Mon, 13 Mar 2006 22:48:14 -0000
Newsgroups php.smarty.cvs
Message-ID <cvspete_morgan1142290094@cvsserver>
pete_morgan		Mon Mar 13 22:48:14 2006 UTC

  Modified files:              
    /smarty/docs/en/designers/language-custom-functions	
                                                       	language-function-fetch.xml 
  Log:
  tweaks
  
http://cvs.php.net/viewcvs.cgi/smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml?r1=1.9&r2=1.10&diff_format=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml:1.9 smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml:1.10
--- smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml:1.9	Tue Sep 13 19:03:11 2005
+++ smarty/docs/en/designers/language-custom-functions/language-function-fetch.xml	Mon Mar 13 22:48:14 2006
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
 <sect1 id="language.function.fetch">
  <title>{fetch}</title>
   <para>
@@ -13,7 +13,7 @@
   <para>
    If you supply the special "assign" attribute, the output of the
    {fetch} function will be assigned to this template variable instead of
-   being output to the template. (new in Smarty 1.5.0)
+   being output to the template.
  </para>
  
  <informaltable frame="all">
@@ -62,29 +62,32 @@
  <note>
   <title>Technical Note</title>
   <para>
-   If template security is turned on and you are
-   fetching a file from the local file system, this will only allow
-   files from within one of the defined secure directories.
-   (<link linkend="variable.secure.dir">$secure_dir</link>)
+   If template <link linkend="variable.security">$security</link>
+   is turned on and you are
+   fetching a file from the local file system, {fetch} will only allow
+   files from within one of the defined 
+   <link linkend="variable.secure.dir">secure directories</link>.
   </para>
  </note>
  <example>
-  <title>fetch</title>
+  <title>{fetch} examples</title>
   <programlisting>
 <![CDATA[
 {* include some javascript in your template *}
-{fetch file="/export/httpd/www.example.com/docs/navbar.js"}
+{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 file='http://www.myweather.com/68502/'}
 
 {* fetch a news headline file via ftp *}
-{fetch file="ftp://user:[email protected]/path/to/currentheadlines.txt"}
+{fetch file='ftp://user:[email protected]/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 ""}
-  <b>{$weather}</b>
+{fetch file='http://www.myweather.com/68502/' assign='weather'}
+{if $weather ne ''}
+  <div id="weather">{$weather}</div>
 {/if}
 ]]>
   </programlisting>
@@ -92,7 +95,8 @@
  <para>
  See also
  <link linkend="language.function.capture">{capture}</link>,
- <link linkend="language.function.eval">{eval}</link>
+ <link linkend="language.function.eval">{eval}</link>,
+ <link linkend="language.function.assign">{assign}</link>
  and
  <link linkend="api.fetch">fetch()</link>.
  </para>