Skip to main content
May 10, 2007
Answered

Multiple Application.cfc files

  • May 10, 2007
  • 4 replies
  • 1271 views
Hi everyone,

I was wondering if you could advise. I have my normal site set-up with your standard kind of ad-hoc cfm templates and an application.cfc. All pretty standard.

What I want to know is, If I setup a sub folder called "my_folder" and then have an application.cfc within there with it's own set of ad hoc cfm files (index.cfm etc) - how will it behave having the other application.cfc file in the root?

What I basically want is my sub folder to run as it's own kind of smaller application. I don't want it to inherit anything from the application.cfc in the root of the website. Does coldfusion work like this?

As far as I understand it, CF will first look for an application.cfc file nearest to the template being called, if it doesn't find it, it then goes up a level and so forth - then again, this could be the other way round, going from top (root) through to lower levels until it finds one.

Any help or advice is very welcome, many thanks.

Michael.
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    you are correct:
    application.cfc in same folder is processed if found, if not then parent
    folder is looked into for application.cfc, etc etc etc
    --

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

    4 replies

    Inspiring
    May 10, 2007
    tclaremont wrote:
    > CF processes the very first Application.cf* file it encounters when moving up
    > the directory tree from the current directory.

    i think using "Application.cf*" is a bit misleading in the context of CF7:
    if cf7 encounters BOTH Application.cfc AND Application.cfm it will
    process the .cfc and ignore .cfm file


    --
    Azadi Saryev
    Sabai-dee.com
    Vientiane, Laos
    http://www.sabai-dee.com
    tclaremont
    Inspiring
    May 10, 2007
    CF processes the very first Application.cf* file it encounters when moving up the directory tree from the current directory.

    So, if there is such a file in the current directory, it uses that file. Once it encounters an Application.cf* file it does NOT continue up the tree and process subsequent Application.cf* files.
    Inspiring
    May 10, 2007
    What happened when you tried it?
    Newsgroup_UserCorrect answer
    Inspiring
    May 10, 2007
    you are correct:
    application.cfc in same folder is processed if found, if not then parent
    folder is looked into for application.cfc, etc etc etc
    --

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com