Skip to main content
Known Participant
March 28, 2008
Question

Difference b/w a custom tag and cfinclude

  • March 28, 2008
  • 2 replies
  • 803 views
Hi,
can anyone pls describe the difference between a cold fusion custom tag and cfinclude. Or how they are processed in the server? While we use the custom tag it nearly functions same as cfinclude....i can't think of any ...
    This topic has been closed for replies.

    2 replies

    Inspiring
    March 28, 2008
    ajithmanmu wrote:
    > Hi,
    > can anyone pls describe the difference between a cold fusion custom tag and
    > cfinclude. Or how they are processed in the server? While we use the custom tag
    > it nearly functions same as cfinclude....i can't think of any ...
    >

    <cfinclude...> does just that. It logically includes the code in the
    current template to be parsed at that point and time. With
    <cfinclude...> the code exists in the same scope is the entire template
    sharing all variables.

    A custom tag is a separate template with it's own local variables as
    well as start and end states that can be used to create much more
    sophisticated interactions. One thing that a custom tag can do that an
    include can not do is reiteration, where a tag can dynamically call itself.


    Participating Frequently
    March 28, 2008
    cfınclude is faster and really faster than any custom tag call. But you have some kind of isolation and reusability in custom tags.

    Having custom variables scope within custom tags is also a nice feature.