View Source

[examples]
context.wtcl
cookies.wtcl
cookiesIntro.wtcl
errors.wtcl
errorsIntro.wtcl
expr.wtcl
fish.jpg
fish.wtcl
flush.wtcl
flushIntro.wtcl
form.wtcl
formIntro.wtcl
index.wtcl
ready.wtcl
scripting.wtcl
scripting.wtcl~
scriptingIntro.wtcl
session.wtcl
sessionIntro.wtcl
uploads/
uploads.wtcl
uploadsIntro.wtcl
virtual.wtcl
virtualIntro.wtcl
File: / examples / scripting.wtcl~

Lines Size Modified Created Owner MIME Types
55 932 2010/05/22 19:39:40 2011/06/13 15:35:16 BUILTIN\Administrators application/x-wtcl, text/x-wtcl

0001
<?
0002
0003
include ../lib/examplePage.wtcl
0004
0005
::wt::examples::setTitle "Basic Scripting"
0006
0007
include ../lib/header.wtcl
0008
0009
?>
0010
0011
<h3>Script Sections</h3>
0012
0013
<p>Enclose scripts with <code>&lt;?</code> and
0014
  <code>?&gt;</code> tokens:</p>
0015
0016
<code>
0017
&lt;?
0018
0019
  # Do a redirect:
0020
  redirect http://www.modwtcl.info
0021
0022
?&gt;
0023
</code>
0024
0025
<p>Expressions can be evaluated with the
0026
  <code>&lt?=</code> token:</p>
0027
0028
<code>
0029
&lt;?= expr rand() ?&gt;
0030
</code>
0031
0032
<h3>Content Sections</h3>
0033
0034
<p>All other text is considered content. This content is normally
0035
passed through <code>subst</code> before being emitted
0036
with <code>puts</code>. Variable and command
0037
substitutions will be performed unless otherwise configured.
0038
You can customize output handling by overriding
0039
<code>puts</code>.</p>
0040
0041
<code>
0042
&lt;?
0043
0044
set variable tree
0045
0046
proc command {args} {
0047
  return rocks
0048
}
0049
0050
?&gt;
0051
0052
Content may contain \${variable}s and \[command substitutions\].
0053
</code>
0054
0055
<? include ../lib/footer.wtcl ?>