Extending application.cfc in a subdirectory

前端 未结 3 1413
心在旅途
心在旅途 2020-12-05 15:50

I have the following two files and would like the second to extend the first:

  1. wwwroot\\site\\application.cfc
  2. wwwroot\\site\\dir\\application.cfc
3条回答
  •  忘掉有多难
    2020-12-05 16:13

    Sean Corfield has a blog entry explaining how to extend a root Application.cfc.

    Below is the relevant information copied from that entry.


    Here's your root CFC /Application.cfc:

    
    
        
        
    
    
    

    Here's your proxy CFC /ApplicationProxy.cfc:

    
    
    

    It's completely empty and serves merely to create an alias for your root /Application.cfc. Here's your subdirectory CFC /app/Application.cfc:

    
    
        
            

    app.Application.onSessionStart()

    app.Application.onRequestStart()


    The root of each individual site should have its own Master App:

    /site1/Application.cfc
    /site2/Application.cfc
    /site3/Application.cfc
    

    All these applications are separate individual apps with nothing shared between them.

    If any of these individual sites need to have sub-applications, then there should be ApplicationProxy.cfc alonside the Master,

    e.g.
    /site1/ApplicationProxy.cfc
    /site2/ApplicationProxy.cfc
    

    Then, for each sub-application you have the one that extends the proxy:

    e.g.
    /site1/subA/Application.cfc
    /site1/subB/Application.cfc
    /site2/subA/Application.cfc
    

提交回复
热议问题