[Catalyst] subrequest question using a Mason view

Joe Landman landman at scalableinformatics.com
Mon Dec 26 22:35:56 CET 2005


Emily Latella moment.

  Never mind.  Found it.  My fault.

Joe Landman wrote:
> Hi folks:
> 
>   I have a Mason view that I want to pull a subrequest into (e.g. have 
> Mason pull down some XML to generate a form from).  So I did an
> 
> % $text    = $c->subreq("/xml/user.xml");
> 
> before handing the xml to XML::Smart.  The problem is that the 
> $c->subreq doesn't seem to work in Mason.  I see some (rather hackish) 
> workarounds for it, but I am wondering if this was implemented only in 
> TT or if Mason masks this part of the API from us.
> 
> The error I am getting is:
> 
> Couldn't render component "/admin/user.html" - error was "Can't locate 
> object method "subreq" via package "SICP" at 
> /opt/sice/2.0/sites/SICP/html/components/user.mason line 16. Stack: 
> [/opt/sice/2.0/sites/SICP/html/components/user.mason:16] 
> [/opt/sice/2.0/sites/SICP/html/admin/user.html:36]"
> 
> Lines 16 and 17 of user.mason looks like this
> 
> % $text = $c->subreq($c->uri_for("/xml/user.xml"));
> % $xml    = XML::Smart->new($text);
> 
> and line 36 of user.html looks like this
> 
> <& /components/user.mason,     mode    => $mode    &>
> 
> Does subreq work (and this is just pilot error on my part) under Mason?
> 

-- 
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: landman at scalableinformatics.com
web  : http://www.scalableinformatics.com
phone: +1 734 786 8423
fax  : +1 734 786 8452
cell : +1 734 612 4615



More information about the Catalyst mailing list