$m->file($m->current_comp->source_file) will return the source of the current component. You are on your own as far as parsing the source to determine the component calls, though.
On Apr 4, 2007, at 9:05 PM, William Cox wrote: > Tim, > > 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. > > i guess one question i have is does Mason provide an easy way to get > the source output of a comp or do i have to do that by hand? > > thanks again > -- > William Cox > > email: [EMAIL PROTECTED] > blog: http://my-dimension.com/ > music: http://www.last.fm/user/mydimension/ > photos: http://flickr.com/photos/mydimension/ > > > On 4/4/07, Timothy S. Nelson <[EMAIL PROTECTED]> wrote: >> On Wed, 4 Apr 2007, William Cox wrote: >> >>> i'm trying to do something a little wonky and would like to put it >>> forth to you guys to your feedback. i have a bunch of main level >>> components that all have a header component as their first action. >>> then there are a bunch of other components called later on in the >>> main >>> component. what im trying to do is get the header comp to determine >>> what components are about to be called. this would be easy if it >>> was a >>> footer component, just read through the stack. but at the >>> beginning of >>> the request, the stack doesnt exist yet. >>> so my initial thought is to parse through the main comps source and >>> pull out what i need (and cache it of course). but this is a bit >>> brutish IMO. is there useful information from the lexer/compiler >>> that >>> could be used? or any thoughts on parsing the code? >> >> Use an autohandler. Do something like this: >> >> $string = $m->scomp('mainpagename'); >> >> $footstring = # footer calculations here >> >> print $string; >> print $footstring; >> >> All totally untested, of course, but it's an idea. >> >> :) >> >> --------------------------------------------------------------------- >> | Name: Tim Nelson | Because the Creator is, | >> | E-mail: [EMAIL PROTECTED] | I am | >> --------------------------------------------------------------------- >> >> ----BEGIN GEEK CODE BLOCK---- >> Version 3.12 >> GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- >> PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y- >> -----END GEEK CODE BLOCK----- >> > > ---------------------------------------------------------------------- > --- > 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 > ------------------------------------------------------------------------- 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