|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Calling CFX tags
I've a cf program (pg_view.cfm) which has C++ CFX tag calls for different environment server (like dev, maint, test, prod). I've to manually change the cfx tag name everytime while migrating the cf app from one server to another (e.g. from dev to maint and so on). I'm trying to find a way to make it a dynamic call to avoid manual changes.
In other words, in the pg_view.cfm, I'm calling the cfx tag as CFX_DEV_PG_VIEW FILENAME=......>. When I'm ready to migrate this app to "maint", I've to go back and manually change the tag name from CFX_DEV_PG_VIEW to CFX_MAINT_PG_VIEW. To start with I've set up a variable flag (serverflg) in application.cfm which gets the current template path and picks up the server name. This part is working well. Then I'm calling from pg_view.cfm like this: <CFX_#UCase(Application.serverflg)#_PG_VIEW FILENAME="form.file2get"....> However by doing it this way, I'm getting error which looks like it's an invalid call. Please see the attached jpg error file. Any help will be appreciated? FYI: In the CF Admin, I've the CF tags defined as "CFX_DEV_PG_VIEW, CFX_MAINT_PG_VIEW,......" to execute the corresponding C programs. |
|
#2
|
||||
|
||||
|
I'm at a loss for why you need to name it differently depending on the server, but for sake of argument I'll just go with that you do. So... if you havea variable that indicates which server you're on, why can't you just use if/then-type decisioning to run the code you want?
|
|
#3
|
|||
|
|||
|
You can't use a variable for the tag name. You'll have to use conditional logic or ditch the CFX tag and use COM object calls or something similar.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
|||
|
|||
|
Quote:
Thanks. That resolves the issue. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Calling CFX tags |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|