Mercurial > pub > Impl
diff 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 |
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/ControllerUnit.pm Wed Jul 21 06:27:12 2010 +0400 +++ b/Lib/IMPL/Web/Application/ControllerUnit.pm Mon Jul 26 03:19:06 2010 +0400 @@ -102,18 +102,28 @@ my $params; if ($params = $methodInfo->{parameters} and ref $params eq 'ARRAY') { - return map $this->ResolveParam($_), @$params; + return map $this->ResolveParam($_,$methodInfo->{inflate}{$_}), @$params; } return(); } sub ResolveParam { - my ($this,$param) = @_; + my ($this,$param,$inflate) = @_; if ( $param =~ /^::(\w+)$/ and $publicProps{$1}) { return $this->$1(); } else { - return scalar($this->query->param($param)); + my $value; + if ( my $rx = $inflate->{rx} ) { + $value = $this->action->param($param,$rx); + } else { + $value = $this->query->param($param); + } + + if (my $method = $inflate->{method}) { + $value = $this->$method($value); + } + return $value; } }