diff Lib/IMPL/Web/RestContract.pm @ 199:e743a8481327

Added REST support for forms (with only get and post methods)
author sergey
date Mon, 23 Apr 2012 01:36:52 +0400
parents 2ffe6f661605
children a9dbe534d236
line wrap: on
line diff
--- a/Lib/IMPL/Web/RestContract.pm	Fri Apr 20 16:06:36 2012 +0400
+++ b/Lib/IMPL/Web/RestContract.pm	Mon Apr 23 01:36:52 2012 +0400
@@ -24,13 +24,15 @@
 }
 
 sub ProcessTemplate {
-	my ($this,$t,$obj,@args) = @_;
+	my ($this,$t,$obj,$props) = @_;
+	
+	$props ||= {};
 	
 	if (ref $t eq 'HASH') {
 		my $factory = $t->{factory} || TRestResource;
-		return $factory->new(%$t, target => $obj);
+		return $factory->new(%$t, target => $obj, %$props);
 	} elsif (ref $t eq 'CODE') {
-		return $this->$t($obj,@args);
+		return $this->$t($obj,$props);
 	} else {
 		die InvalidOpException->new();
 	}