On Thu, Apr 05, 2007 at 12:05:54AM -0400, William Cox wrote: > that certainly is one way to do it but it wont work for what i need. > the header component called from the request_comp needs to do some > stuff based on components to be called later. things like bringing in > js scripts and css files if certain components need them. heres an > outline: > > index.html > |-header.cmp > |-compa.cmp > |-compd.cmp > > header.cmp needs to look ahead at what components are about to be > called so it can include the appropriate css and js files. for now, > dont need to worry about anything more than components called just > from index.html, i can ignore comps called from compa.cmp, compd,cmp, > etc.
Assuming that you know in index.html which of comp*.cmp you're going to call, here's another way you could handle this: - comp*.cmp have a <%method javascript>, <%method css>, etc. - index.html calls <& header.cmp, components => [qw(compa.cmp compd.cmp)] &> - header.cmp does for $comp (@components) { $m->comp("$comp:javascript") } (use method_exists or an empty method in the autohandler if you like) Then header.cmp already has a list of the components that are going to be called, and you don't need to do things involving output parsing. If you don't know in index.html which components you're going to call, it might be worthwhile to move your component-choosing logic into an <%init> block or something; separating logic from display has a lot of benefits. hdp. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users