Not yet rated

Problem

How to set the root of your site in a variable when the application may be started in a subfolder

Solution

use a combination of getDirectoryFromPath() and getCurrentTemplatePath() in stead of expandPath('./')

Detailed explanation

Put in your application.cfc in the onApplicationStart() the folowing line of code:

application.settings.BASEPATH = getDirectoryFromPath( getCurrentTemplatePath() );

(or any other variable name offcourse!)


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes