Skip to content

Commit

Permalink
Add make_abs_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelzro committed Oct 11, 2011
1 parent 5aeaf86 commit 177eb04
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/Act/Util.pm
Expand Up @@ -13,7 +13,7 @@ use Act::Database;

use vars qw(@ISA @EXPORT %Languages);
@ISA = qw(Exporter);
@EXPORT = qw(make_uri make_uri_info self_uri localize);
@EXPORT = qw(make_uri make_abs_uri make_uri_info self_uri localize);

# password generation data
my %grams = (
Expand Down Expand Up @@ -96,6 +96,14 @@ sub make_uri
return _build_uri($uri, %params);
}

sub make_abs_uri {
my ( $action, %params ) = @_;

my $uri = $Request{r}->uri;
$uri->path(make_uri(@_));
return $uri;
}

# create a uri pathinfo-style
sub make_uri_info
{
Expand Down Expand Up @@ -348,6 +356,10 @@ Returns an URI that points to I<action>, with an optional query string
built from I<%params>. For more details on actions, refer to the
Act::Dispatcher documentation.
=item make_abs_uri(I<$action>, I<%params>)
Similar to L<make_uri/"">, but returns an absolute URI.
=item self_uri(I<%params>)
Returns a self-referential URI (a URI that points to the current location)
Expand Down

0 comments on commit 177eb04

Please sign in to comment.