I was going to leave this alone but it’s bugging me.
I saw a reference somewhere (I believe in one of the answers here in Google Groups) to “polluting prc/rc” but it read like a personal preference. Didn’t really see any explanation but rather came across as “just one of those things…”
Then I saw the same language here - http://wiki.coldbox.org/wiki/EventHandlers.cfm (see below)
View Args
Data can be passed from your handler to the view via the rc or prc (request collection and private request collection). If you want to pass data to a view without polluting rc and prc, can pass it directly in as the args parameter.
var viewData = {
data1 = service.getData1(),
data2 = service.getData2()
};
event.setView( view='myView', args=viewData );
Access the data in the view like so:
**<cfoutput>**
Data 1: #args.data1#**<br>**
Data 2: #args.data2#
So now it’s bugging me. I’ve been thinking that results from model logic that need to go to the view should be placed in prc structure. I’m wondering - does “prc” get additional processing somewhere that “args” in the above example does not? If so then I suppose I’ll switch to the above method of moving data to the views. If not then I don’t get the point of “polluting” the prc. Does this make sense to anyone?
Thank you!