سؤال

في ColdFusion الإصدار 9، لدي ما يلي في Index.cfm:

<cfdump var="#Application#">

ولكن الشيء الوحيد الذي أعود إليه هو بنية مع تطبيق التطبيق - لا توجد متغيرات أخرى مثل rootpath أو التعيينات أو customtagPath.

إليك ما لدي في Application.cfc:

<cfcomponent output="false">
<cfset this.name = left("App_#hash(getCurrentTemplatePath())#",64)>
<cfset this.applicationTimeout = createTimeSpan(0,8,0,0)>
<cfset this.sessionManagement=True>
<cfset this.loginStorage = "session">
<cfset this.clientManagement = False>
<cfset this.setClientCookies = True>
<cfset this.setDomainCookies = False>
<cfset this.scriptProtect = "all">
<cfset this.rootPath = getDirectoryFromPath(getCurrentTemplatePath())>
<cfset this.mappings = this.rootPath>
<cfset this.customTagPaths = "#this.rootPath#Components">
هل كانت مفيدة؟

المحلول

وذلك لأن تلك الإعدادات ليست في نطاق التطبيق. أنت مربك التطبيق الإعدادات مقابل قيم التطبيق. إذا كنت تريدها متوفرة في نطاق التطبيق، فيمكنك ببساطة ضبطها في OnApplicationStart (). يمكنك أيضا رؤيتهم عبر هذا النطاق بالطبع، لذلك يمكنك نسخ القيم هناك.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top