Mercurial > pub > Impl
comparison Lib/IMPL/Web/Application/ControllerUnit.pm @ 146:60fd224f3e3c
fixed cgi parameters processing
Added parameters inflating feature
Added preprocessed templates, reformatting output
author | wizard |
---|---|
date | Mon, 26 Jul 2010 03:19:06 +0400 |
parents | b56ebc31bf18 |
children | e6447ad85cb4 |
comparison
equal
deleted
inserted
replaced
145:bd10093bb122 | 146:60fd224f3e3c |
---|---|
100 sub MakeParams { | 100 sub MakeParams { |
101 my ($this,$methodInfo) = @_; | 101 my ($this,$methodInfo) = @_; |
102 | 102 |
103 my $params; | 103 my $params; |
104 if ($params = $methodInfo->{parameters} and ref $params eq 'ARRAY') { | 104 if ($params = $methodInfo->{parameters} and ref $params eq 'ARRAY') { |
105 return map $this->ResolveParam($_), @$params; | 105 return map $this->ResolveParam($_,$methodInfo->{inflate}{$_}), @$params; |
106 } | 106 } |
107 return(); | 107 return(); |
108 } | 108 } |
109 | 109 |
110 sub ResolveParam { | 110 sub ResolveParam { |
111 my ($this,$param) = @_; | 111 my ($this,$param,$inflate) = @_; |
112 | 112 |
113 if ( $param =~ /^::(\w+)$/ and $publicProps{$1}) { | 113 if ( $param =~ /^::(\w+)$/ and $publicProps{$1}) { |
114 return $this->$1(); | 114 return $this->$1(); |
115 } else { | 115 } else { |
116 return scalar($this->query->param($param)); | 116 my $value; |
117 if ( my $rx = $inflate->{rx} ) { | |
118 $value = $this->action->param($param,$rx); | |
119 } else { | |
120 $value = $this->query->param($param); | |
121 } | |
122 | |
123 if (my $method = $inflate->{method}) { | |
124 $value = $this->$method($value); | |
125 } | |
126 return $value; | |
117 } | 127 } |
118 } | 128 } |
119 | 129 |
120 sub TransactionWrapper { | 130 sub TransactionWrapper { |
121 my ($self,$method,$action,$methodInfo) = @_; | 131 my ($self,$method,$action,$methodInfo) = @_; |