将变量传递给cfinclude [英] Passing variables to cfinclude

查看:171
本文介绍了将变量传递给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>


$ b

谢谢!

Thanks!

推荐答案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆