X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fxmlhttp.html;h=d0c7990953796562d3aaafa549bdd87abb070052;hb=40a7b3dc653e099f7bd0bd762b649b04c4432db2;hp=425e28e3d437b9631aeead40b2f45e5796e179d3;hpb=9e342300c380e29af1b9678f1a9604609e0061b6;p=freeside.git diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html index 425e28e3d..d0c799095 100644 --- a/httemplate/elements/xmlhttp.html +++ b/httemplate/elements/xmlhttp.html @@ -1,11 +1,19 @@ -<% - my ( $url, @subs ) = @_; +<%doc> - $url .= ( ($url =~ /\?/) ? '&' : '?' ). - 'sub='; +Example: -%> + include( '/elements/xmlhttp.html', + # required + 'url' => $p.'misc/something.html', + 'subs' => [ 'subroutine' ], + # optional + 'method' => 'GET', #defaults to GET, could specify POST + 'key' => 'unique', #unique key + + ); + + +<%init> +my ( %opt ) = @_; + +my $url = $opt{'url'}; +my $method = exists($opt{'method'}) ? $opt{'method'} : 'GET'; +#my @subs = @{ $opt{'subs'}; +my $key = exists($opt{'key'}) ? $opt{'key'} : ''; + +$url .= ( ($url =~ /\?/) ? '&' : '?' ) + if $method eq 'GET'; + +