Touuble with variables.framework.base

40 views
Skip to first unread message

Geoff Parkhurst

unread,
Mar 9, 2010, 1:12:08 PM3/9/10
to framew...@googlegroups.com
Hello

I'm trying to have this kind of file arrangement with fw/1 [1]:

Application.cfc
/views/main/default.cfm
/wwwroot/index.cfm

My apache config serves wwwroot as the DocumentRoot, which allows me
to keep all my views, controllers, application.cfc etc out of the web
root.

I can't seem to find the right combination of
getCurrentTemplatePath(), expandPath() or whatever to make this work.

<cfset variables.framework.base="../" /> doesn't work either...

Can anyone shed any light?

Many thanks
Geoff

[1] http://livedocs.adobe.com/wtg/public/coding_standards/structure.html

Sean Corfield

unread,
Mar 10, 2010, 2:44:25 AM3/10/10
to framew...@googlegroups.com
Hmm, not a combination I've tried.

Could you put Application.cfc in /wwwroot and see if that works? That
combination has been tested.

variables.framework.base = "../"; should work with Application.cfc in
/wwwroot but I suspect the relative path doesn't understand what to do
when index.cfm and Application.cfc are in different places...

Sean

Geoff Parkhurst

unread,
Mar 11, 2010, 6:10:50 PM3/11/10
to framew...@googlegroups.com
On 10 March 2010 07:44, Sean Corfield <seanco...@gmail.com> wrote:
> Hmm, not a combination I've tried.
>
> Could you put Application.cfc in /wwwroot and see if that works? That
> combination has been tested.
>
> variables.framework.base = "../"; should work with Application.cfc in
> /wwwroot but I suspect the relative path doesn't understand what to do
> when index.cfm and Application.cfc are in different places...

No joy - I can't seem to get base="../" to work, even with both
app.cfc and index.cfm in the web root. That's on both CF8/Apache and
Railo (Express)

Still experimenting...

Thanks
Geoff

Geoff Parkhurst

unread,
Jul 6, 2011, 10:49:36 AM7/6/11
to framew...@googlegroups.com
Well, after a year, I decided to revisit this and have kind of solved
it with this.mappings in Application.cfc...

<cfset this.mappings["/views"]="#replace(getDirectoryFromPath(getCurrentTemplatePath()),"\","/","all")#views">

... which works, but doesn't feel as "nice" as something like <cfset
variables.framework.base="../"> would.

So, my views and Application.cfc are outside my webroot which I like -
I don't want hackers poking around in myapp.com/views

/controllers next...

Reply all
Reply to author
Forward
Message has been deleted
0 new messages