Model Glue Tips Part 7: Set myself in your views

Posted by Mark Drew on code on August 17, 2007

Tagged under model-glue

This is a quick tip for today. In all views you will probably be linking to other events, now of course you could write something like:

My Event

But what happens if you change the event key to something else (you can do that in the ModelGlue configuration section in the ColdSpring.xml file, see the property for “eventValue”) such as “go” or “action”? You would have to change every view.

A simple way round this is to put at the top of each view the following:

<cfset myself = ViewState.getValue('myself')>

And then change your links to:

My Event

What do you think?




comments powered by Disqus