On 8/3/07, Alan Humphrey <[EMAIL PROTECTED]> wrote:
> Hi -
>
> I'm seeing a \r\n inserted before component results and I can't figure out
> where they're coming from.
>
> Here's the code:
>
> <%def .image_value>
> % if ( defined $c->stash->{default_image} ) {
> % print $c->stash->{default_image}->$column;
> % }
> <%args>
> $column
> </%args>
> </%def>
>
> Here's a typical call:
>
> <input type="hidden" name="id" value="<& .image_value, column=>'id'
> &>" >
Hi, Alan:
I dont have experience with Catalyst, so maybe I was wrong. But can
you write the above Mason snippet into:
% my $img = $c->stash->{ default_image };
<input type="hidden" name="id" value="<% get_img_value($img, 'id') %>" >
then somewhere in your module (make sure it's viewable in Mason comps):
sub get_img_value
{
my($img, $col) = @_;
return defined $img ? $img->$col : '';
}
So you won't have extra whitespace problems.. :-)
Regards,
Xicheng
> And here's the result on the page:
>
> <input type="hidden" name="id" value="
> 4" >
>
> Mason 1.36 - freshly installed.
> Apache 2.2
>
> Any ideas? Thanks!
>
> - Alan
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
--
perl -le'print"So~*kde~box*DS*Zoxf*fe|er"^$\x23'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users