This thread got me thinking about my code in CFMX 6.1. If I have a cfscript-based UDF inside of a custom tag, and that function is only called in the executionmode="end" block, is it a best-practice to declare that function in the end block, or does it not matter where the fuction is defined inside of the tag? I do not want CF to parse the same function twice, once for the start tag and once for the end tag, if it is only being used by the end tag.

Thank you,
Mike Chabot

>Jamie - If you are on CF5 you only have 2 choices really...
>
>Use the request scope. You would define the UDF in the request BEFORE
>you call the custom tag. Ie, Application.cfm may cfinclude a file of
>UDFs where each UDF is copied to the request scope. You would call the
>UDF in the CT by using request.foo()
>
>In the custom tag, use cfinclude to include the file only in
>executionMode = start.
>
>Both of those will work.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to