Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a ColdFusion equivalent to PHP for include_once?

I've been adding this to my pages:

pagewithinclude.cfm

<cfinclude template = "_pagename.cfm">

_pagename.cfm

<cfif Not IsDefined("variables.included_pagename")>
<cfparam name = "variables.included_pagename" default = "1">

rest of page

</cfif>

Is there a better way in CF? Something similar to PHP's include_once?

like image 402
davidosomething Avatar asked Mar 25 '10 16:03

davidosomething


1 Answers

Nope, what you've done is probably the best way to do it. Although I'd use a Request variable instead.

like image 135
Raymond Camden Avatar answered Sep 21 '22 17:09

Raymond Camden