Changeset 440
- Timestamp:
- 05/27/08 02:35:08 (22 months ago)
- Files:
-
- 1 modified
-
veekun/trunk/lib/Vee.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
veekun/trunk/lib/Vee.pm
r428 r440 8 8 use Image::Size; 9 9 use LWP::UserAgent; 10 use Storable qw/dclone/; 10 11 use Time::Out qw/timeout/; 11 12 use YAML qw//; … … 139 140 sub uri { 140 141 my ($self, $con, $sub, @args) = @_; 142 141 143 my $url = $self->uri_for( 142 144 $self->controller($con)->action_for($sub), … … 144 146 ); 145 147 $url =~ tr/&/;/; # fuck ampersands 148 146 149 return $url; 150 } 151 152 =head2 uri_for 153 154 Override of Catalyst's uri_for that clones parameters before passing them 155 along, so I don't have to worry about e.g. reusing the same query args hashref 156 several times in a template. 157 158 =cut 159 160 sub uri_for { 161 my ($self, @etc) = @_; 162 163 # Only the last parameter can be a query arg hashref 164 if (@etc and ref $etc[-1] eq 'HASH') { 165 $etc[-1] = dclone $etc[-1]; 166 } 167 168 return $self->next::method(@etc); 147 169 } 148 170
