cvs: smarty /docs designers.sgml programmers.sgml

"Monte Ohrt" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmohrt1060273830@cvsserver>
mohrt		Thu Aug  7 12:30:30 2003 EDT

  Modified files:              
    /smarty/docs	designers.sgml programmers.sgml 
  Log:
  add math and default_resource_type to docs
  
  
Index: smarty/docs/designers.sgml
diff -u smarty/docs/designers.sgml:1.73 smarty/docs/designers.sgml:1.74
--- smarty/docs/designers.sgml:1.73	Thu Aug  7 09:59:51 2003
+++ smarty/docs/designers.sgml	Thu Aug  7 12:30:30 2003
@@ -109,7 +109,7 @@
 {html_options values=$vals selected=$selected output=$output}
 &lt;/SELECT&gt;</programlisting>
 </example>
-		</sect1>
+	</sect1>
    <sect1 id="language.syntax.quotes">
     <title>Embedding Vars in Double Quotes</title>
     <para>
@@ -134,6 +134,29 @@
 {cycle values="one,two,`$smarty.config.myval`"} &lt;-- must have backticks</programlisting>
 </example>
 		</sect1>
+   <sect1 id="language.math">
+    <title>Math</title>
+    <para>
+	Math can be applied directly to variable values.
+    </para>
+    <example>
+     <title>math examples</title>
+     <programlisting>	 
+{$foo + 1}
+
+{$foo * $bar}
+	 
+{* some more complicated examples *}
+	 
+{$foo-&gt;bar - $bar[1] * $baz-&gt;foo-&gt;bar() - 3 * 7}
+
+{if ($foo+$bar.test%$baz*134232+10+$b+10)}
+
+{$foo|truncate:"`$fooTruncCount / $barTruncFactor -1`"}
+
+{assign var="foo" value="`$foo + $bar`"}</programlisting>
+</example>
+	</sect1>
 
   </chapter>
 
Index: smarty/docs/programmers.sgml
diff -u smarty/docs/programmers.sgml:1.39 smarty/docs/programmers.sgml:1.40
--- smarty/docs/programmers.sgml:1.39	Thu Aug  7 09:59:51 2003
+++ smarty/docs/programmers.sgml	Thu Aug  7 12:30:30 2003
@@ -495,6 +495,15 @@
 	  {$var|smarty:nodefaults}.
       </para>
      </sect1>
+     <sect1 id="variable.default.resource.type">
+      <title>$default_resource_type</title>
+      <para>
+	  This tells smarty what resource type to use implicitly. The default value
+	  is 'file', meaning that $smarty->display('index.tpl'); and
+	  $smarty->display('file:index.tpl'); are identical in meaning. See the
+	  <link linkend="template.resources">resource</link> chapter for details.
+      </para>
+     </sect1>
     </chapter>
 
    <chapter id="api.functions">
@@ -1388,6 +1397,14 @@
           for more information on how to setup a function for fetching
           templates.
          </para>
+		 <note>
+		 <title>Technical Note</title>
+		 <para>
+		 A resource name must be at least two characters in length. One
+		 character resource names will be ignored and used as part of the file
+		 path, such as $smarty->display('c:/path/to/index.tpl');
+		 </para>
+		 </note>
          <para>
           The php-function-array <parameter>resource_funcs</parameter>
           must have 4 or 5 elements. With 4 elements the elements are
@@ -2265,10 +2282,12 @@
   <sect1 id="template.resources">
    <title>Resources</title>
    <para>
-    The templates may come from a variety of sources. When you display or
-    fetch a template, or when you include a template from within another
-    template, you supply a resource type, followed by the appropriate path
-    and template name.
+	The templates may come from a variety of sources. When you display or fetch
+	a template, or when you include a template from within another template,
+	you supply a resource type, followed by the appropriate path and template
+	name. If a resource is not explicitly given the value of <link
+	linkend="variable.default.resource.type">$default_resource_type</link> is
+	assumed.
    </para>
    <sect2 id="templates.from.template.dir">
     <title>Templates from $template_dir</title>



-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.