Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make Custom Tag return caller-specified variable? 1

Status
Not open for further replies.

philcha

Programmer
May 10, 2000
109
GB
I've seen custom tags which allow the caller to specifiy the name of the returned variable(s), but all the ones I've seen have been encrypted.

How can I make my own customs tags to this?

E.g.
<CF_myTag RetVar=&quot;myVar&quot; ....>
 
Consider using the &quot;Request&quot; scope for these types of variables.

A Request variable is &quot;visible&quot; to the calling template.

You may want to review this &quot;custom tag&quot; tutorial as well. Let me know if it helps : )


 
feedback@cfhub.com,

Thanks for the tip.

I had a look at the article and was concerned that its recommendations appeared to break the rules of modularity:
* Request variables are available to all code which serves the page request, so they're like global / common variables in other languages - to be used with caution.
* The article seemed to suggest using Caller variables in the called modules to look at variables in the calling module. That's dangerous. If the called module needs the info, the calling module should pass it as an argument (attributes).

Meanwhile I found a solution via another channel,and am going to enter it as a Tip.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top