If your custom tag doesn't surround anything, make sure you add this
line:

<cfif thistag.ExecutionMode is "end"><cfexit method="exitTag"></cfif>

That way if you have programmers that self close tags (<cf_customtag
/>), it won't run twice.

Steve

-----Original Message-----
From: Jason Fisher [mailto:[email protected]] 
Sent: Tuesday, May 11, 2010 12:32 PM
To: cf-talk
Subject: Re: Which code reuse method?


+1 to making it a custom tag in the server's default custom tag
directory.  



> Definitely a custom tag or a
cfc seem like overkill.

Custom tag is just that:  a bit of code that can be called in a single
tag, 
that's all.  Nothing 'overkill' about it to implement for a simple 
computation.  <cf_getMyLink relativePath="/path/to/mytemplate.cfm" 
environment="development" /> seems fairly straightforward.

----------------------------------------

From: "Gerald Guido" <[email protected]>
Sent: Tuesday, May 11, 2010 11:18 AM
To: "cf-talk" <[email protected]>
Subject: Re: Which code reuse method?

>>However, my secondary concern is that we do not have a process for 
sharing
code in-house so I could see whatever method I choose turning into a
sort 
of
default method of code reuse (even when not appropriate).

If that is the case, I would recommend making it a custom tag and
sticking
it in the custom tags folder in the CF admin.That way it is avalible to
everyone with out having to deal with mappings and all that.

G!

On Tue, May 11, 2010 at 10:56 AM, Shannon Rhodes 
<[email protected]>wrote:

>
> I'm probably overthinking this, but I have a really simple snippet of 
code
> that I want to make easily available to other developers in-house.  It

takes
> no input variables; all it does is figure out the correct link to 
reporting
> services based on the server environment (dev/QA/prod).
>
> Given the simplicity, should this just be an include?  Or at most a
UDF
> (though I fail to see the point there, since you have to include those

too,
> and I'm not taking input parameters).  Definitely a custom tag or a
cfc 
seem
> like overkill.
>
> However, my secondary concern is that we do not have a process for 
sharing
> code in-house so I could see whatever method I choose turning into a
sort 
of
> default method of code reuse (even when not appropriate).  Also, I'm
> thinking if I'm really going to approach this properly I need to
request 
a
> mapping to a folder above the web root rather than simply throwing in
a 
new
> folder and calling it "cfincludes".  Mappings always turn into a PITA 
around
> here, but I want to do this right.
>
> Advice for getting this team moving in the right direction (noting I
am 
not
> in management here)?  Thanks!
>
> 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333581
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to