[Catalyst] A View that may include elements optionally returned from other funcs

Steve H s_t_e_v_e_h at hotmail.com
Tue Apr 24 01:42:23 GMT 2007

Hi all,

(preamble) I've been working for a couple of months now on the strategy, 
constraints and designs for using Catalyst for a portal CRM app.  I chose to 
use Seamstress rather than TT, as it seems a more contemporary approach - at 
least the notion of workig with the HTML tree compared to using another mini 
language (anyway, perhaps if the related doco was more extensive, 
example-wise, then I'm sure Seamstress would get a larger following).
Anyway.... the dilema I have is: With Catalyst, how do I compose a html 
document from multiple sources. For example I have many Boxes of data, the 
creation of which I'd like to generalise, and optionally include 
some/none/all in any finally composed page/document (and positioned at for 
examle, tags in any doc they could appear in)... like a menu or a hot-list 
or other things that may be common to many documents/pages.
At face value, Catalysts model of a Controller to crunch/prepare the data 
then a View to render a doc/page, seems to promote a 1-document per view 
For this sort of er, Portal app I'm working on, I'd like to when composing a 
page, identify whether or not particular common elements (say, boxes of 
data) should be included, and then merely call out to some common functoin 
to build the things which I then stitch them in at the appropriate place in 
the final doc.
Seems to me that at the point in processing I need to intervene (the final 
page's View), the doc is the compiled/hash representing the html doc tree.  
I can certainly look_down() and replace_content() in that tree.... how 
though can I call some other function that will return the appropriate 
structure to stitch in.  If they were their own View, they would parse a doc 
fragment (or even a larger doc with lots of common fragments) into a tree in 
it's new()... then I'd call in to some function that would build and return 
me the structure that I could push/replace/splice in to the tree I'm 
Although I'm a well experienced programmer from way back :(from the old 
top-down days though), I am still struggling to get my head around the whole 
interitence and calling model of the Catalyst OO framework... in who does 
what to who, when, for how much, and where did they meet.
Hopefully what I'm trying to do  is pretty 101 stuff, and someone with the 
right Catalyst/Seamstress stuff can 'show me the way'... as I'm going nuts 
trying out different things from Google'ing.


Advertisement: Visit LetsShop.com to WIN Fabulous Books Weekly 

More information about the Catalyst mailing list