将变量传递给 cfinclude [英] Passing variables to cfinclude
本文介绍了将变量传递给 cfinclude的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将变量传递给我从另一个页面包含的 cfm 页面?
How can I pass a variable to a cfm page that I'm including from another page?
例子:
<cfset a.name = "me">
<cfset a.age = 135>
<cfinclude template="displayNameAndAgeFrom_A.cfm">
而 displayNameAndAgeFrom_A.cfm 是
and displayNameAndAgeFrom_A.cfm is
<cfoutput>#a.name# #a.age#</cfoutput>
谢谢!
推荐答案
AFAIK,这应该可以正常工作,就像你发布它的方式一样,根本不需要传递任何东西.外部/调用页面中可用的任何值都在包含页面中可用.
AFAIK, this should work, exactly the way you posted it, without having to pass anything at all. Any values available in the outside/calling page are available in the included page.
这篇关于将变量传递给 cfinclude的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文