OK - is there a sexier way to do this? i.e. less code & more reliable?
- the CFserver has no mappings defined
- my application is in a subdirectory of a virtual host where the root directory has no cfmx files at all ["/Registration"]
- application.cfc is new to me today
- I need to filter every request through the onRequest method
- onRequest method arg "targetPage" gets the ~requested template from the http root~
- a cfinclude needs either a ~relative path~ from the current template OR an abslute path from the server root.
- [I'm just working my thoughts through here]
ok - so I have in my Application.cfc
this.mappings["root"] = Replace(getDirectoryFromPath(getCurrentTemplatePath()), "Registration/", "", "all");
then in my onRequest method:
so it works, [or so it seems] and always includes from the server root - but, is it right? is there a better way?
Retrieving data ...