[Catalyst] + in GET param
Gavin Henry
ghenry at perl.me.uk
Wed Sep 12 10:46:17 GMT 2007
Matt Rosin wrote:
> I wonder if this is similar to something bug I saw a few months ago.
> I tried to pass a GET url into a TT2 field but the question mark in the
> url kept getting url-encoded to %3F. I was wondering if it was a Unicode
> problem, but it may have been wrong url_for syntax.
>
> Here is a snippet from the old code before I solved the problem (the chr
> didn't work IIRC).
>
> my $qm = chr(63); # my terminal can't print a question mark in utf8 it
> makes a hex code %3F!
> $c->stash->{prevpageurl} =
> $c->uri_for("/admin/admin_portal_transactions_list".$qm."page=$prevpage&collapsed=$collapsed");
>
>
>
> IIRC I was unable to solve the problem using the stash, and possibly I
> also tried uri_for then.
> Finally I solved it by converting the function to pass parameters as
> virtual folders in the url path.
>
> However yes I just tried what Miyagawa-san had and did it with a TT
> template too. It works fine with url_for.
>
Weird. I'll try here to.
I'm actually generating the url in TT, so maybe I'll try moving it into
my controller:
[% FOREACH subscriber IN sublist %]
<tr>
<td>[% subscriber.detail.subid %]</td>
<td>[% subscriber.detail.firstname %]</td>
<td>[% subscriber.detail.lastname %]</td>
[% user = { username => subscriber.detail.email1 } %]
<td><a href="
[% c.uri_for('/admin/usage/edit', subscriber.detail.subid, user); %]"
title="Click for more information">[% subscriber.detail.email1 %]
</a></td>
<td>[% subscriber.detail.orgname %]</td>
<td>[% subscriber.status %]</td>
<td>[% subscriber.detail.tariff_name %]</td>
<td>[% subscriber.detail.dateend.strftime('%a %d %b %Y'); %]</td>
</tr>
[% END %]
More information about the Catalyst
mailing list