1 package TestApp::Controller::Engine::Request::URI;
\r
4 use base 'Catalyst::Base';
\r
6 sub default : Private {
\r
7 my ( $self, $c ) = @_;
\r
9 $c->forward('TestApp::View::Dump::Request');
\r
12 sub change_path : Local {
\r
13 my ( $self, $c ) = @_;
\r
16 $c->req->path( '/my/app/lives/here' );
\r
18 $c->forward('TestApp::View::Dump::Request');
\r
21 sub change_base : Local {
\r
22 my ( $self, $c ) = @_;
\r
24 # change the base and uri paths
\r
25 $c->req->base->path( '/new/location' );
\r
26 $c->req->uri->path( '/new/location/engine/request/uri/change_base' );
\r
28 $c->forward('TestApp::View::Dump::Request');
\r
31 sub uri_with : Local {
\r
32 my ( $self, $c ) = @_;
\r
34 # change the current uri
\r
35 my $uri = $c->req->uri_with( { b => 1 } );
\r
36 my %query = $uri->query_form;
\r
38 $c->res->header( 'X-Catalyst-Param-a' => $query{ a } );
\r
39 $c->res->header( 'X-Catalyst-Param-b' => $query{ b } );
\r
41 $c->forward('TestApp::View::Dump::Request');
\r