Mercurial > pub > Impl
diff Lib/IMPL/Web/Application/Action.pm @ 266:89179bb8c388
*corrected TTView to handle plain (and undefined) values
*added URL generating methods to Application::Action
*fixed the compare validatior for schemas
author | cin |
---|---|
date | Mon, 14 Jan 2013 03:10:06 +0400 |
parents | 32aceba4ee6d |
children | 4abda21186cd |
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/Action.pm Thu Jan 10 03:25:02 2013 +0400 +++ b/Lib/IMPL/Web/Application/Action.pm Mon Jan 14 03:10:06 2013 +0400 @@ -5,6 +5,7 @@ use IMPL::Const qw(:prop); use IMPL::Web::CGIWrapper(); +use URI; use IMPL::declare { base => [ @@ -50,6 +51,12 @@ $this->_launder($value, $rx ); } +sub urlParam { + my ($this,$name,$rx) = @_; + + $this->_launder(scalar( $this->query->url_param($name) ), $rx); +} + sub rawData { my ($this) = @_; @@ -81,6 +88,28 @@ return $this->query->url(-base => 1); } +sub applicationUrl { + shift->application->baseUrl; +} + +sub applicationFullUrl { + my ($this) = @_; + + return URI->new_abs($this->application->baseUrl, $this->query->url(-base => 1)); +} + +sub CreateFullUrl { + my ($this,$path) = @_; + + return $path ? URI->new($path,$this->applicationFullUrl) : $this->applicationFullUrl; +} + +sub CreateAbsoluteUrl { + my ($this,$path) = @_; + + return $path ? URI->new($path,$this->applicationUrl) : $this->applicationUrl; +} + sub _launder { my ($this,$value,$rx) = @_;