[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Beta for MiniVend 3.15 at ftp://ftp.minivend.com/pub/beta/
W H A T ' S N E W
MiniVend 3.15 incorporates some new features -- I couldn't resist. 8-)
* A new ASP-style syntax is supported:
<HTML MV=mvasp><BODY>This is HTML</BODY>
<%
$Document->write('This is code');
%>
HTML again.
<%
$Document->write('Code again.');
%>
* A new Perl object set is there to support the ASP, but
it also is available via
[perl arg=new]
$Document->write("Your name is $Values->{name}");
[/perl]
Objects supported are:
$CGI->{key} Hash reference to submitted values
$Document->write() Writes to page
$Carts->{cartname} Direct reference to shopping carts
$Config->{key} Direct reference to $Vend::Cfg
$Items->[n] Direct reference to current cart
$Scratch->{key} Direct reference to scratch area
$Session->{key} Direct reference to session area
$Tag->tagname(@args) Call a tag as a routine (UserTag too!)
$Values->{key} Direct reference to user form values
&Log($msg) Log to the error log
* Tag parameters quoted with parameter=`code` are the equivalent of
parameter="[calc]code[/calc]".
* Tag parameters can be quoted with | to strip whitespace:
[page href=|
[value name="whatever"]
|]
is equivalent to
[page href="[value name="whatever"]"]
* Tag parameters can be quoted with | to strip whitespace:
[page href=|
[value name="whatever"]
|]
is equivalent to
[page href="[value name="whatever"]"]
* Tag parameters can be quoted with @ to insert a scratch
value:
[value name=foo set=@bar@]
[value name=foo set="[scratch bar]"]
This can be useful when setting large values into variables,
as it is much more efficient than the previous method.
* Input values filters can be set up by quoting with ! and
an operation:
<INPUT TYPE=text NAME=phone VALUE="[value name=!phone:digits!]">
This guarantees that the value of "phone" will be digits only
when sent to MiniVend. Filters include:
uc UPPER CASE
lc lower case
digits only digits
word only A-Z a-z _ 0-9
urlencode space becomes %20
entities < becomes <
strip strip leading/trailing whitespace
no_white strip all whitespace
gate set to blank unless scratch variable
with same name is non-blank
n (where n is an integer) length limit
remove delete existing filter (if any)
Filters can also be created with Filter directive
and/or [input-filter op="uc"][/input-filter]
* Filter directive allows filtering of certain CGI variables
for input conditioning; this is not session dependent and
automatically operates on any iteration of the variable...
Filter phone digits 10
That removes all non-digit values from the variable "phone",
then limits length to 10. Any session-based filters are applied
after this one.
* [input-filter name=foo] CODE [/input-filter]
Sets a routine passed to the equivalent of a "[calc]" tag.
The value to be filtered is placed in the variable "$mv_filter_value",
and the name is set to "$mv_filter_name". It is possible to
do something like:
[input-filter name=country]
my $touched = '[tag touch country][/tag]';
my $val = $mv_filter_value;
my $prospect = &tag_data('country', 'name', $val);
return $prospect || $val;
[/input-filter]
That will return the name of a country if it is found as a key
in the database (assuming the simple demo country definitions).
* Small improvements in the parser, notably optimization when
positional parameters are used.
* ECML is supported via the Vend::ECML module. To map the
checkout form values from MiniVend UserDB names, with an [ecml ...]
tag:
[ecml state]
is equivalent to:
<INPUT TYPE=text
VALUE="[value state]"
NAME=Ecom_ShipTo_Postal_StateProv
SIZE=2>
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
131 Willow Lane, Floor 2 | || _ \
It's a little-known fact Oxford, OH 45056 | || |_) |
that the Y1K problem caused <mikeh@minivend.com> |___| _ <
the Dark Ages. -- unknown 513.523.7621 FAX 7501 |_| \_\