coldfusionscaffoldingfw1

Light weight scaffolding for FW/1


I am trying to create a light weight scaffolding facility for FW/1. Right now I have a file called scaffold.cfc in the controller which looks like

<cfcomponent hint="this is expected to be extended, and never used directly">



<cfscript>
function init(fw) { variables.fw = fw; }

void function home (required struct rc) output="false"  {

    /* TODO: Generic load  */

    setView("scaffold.home");
    }

void function create (required struct rc) output="false"    {

    /* TODO: Generic create  */

    setView("scaffold.create");
    }

void function show (required struct rc) output="false"  {

    /* TODO: Generic show  */

    setView("scaffold.show");
    }

...

</cfscript>


</cfcomponent>

I want to make sure that index.cfm?action=scaffold.* or index.cfm/scaffold/* can never ran.

Where is the best place to do this?


Solution

  • You could place the scaffold.cfc outside the controllers folder so FW/1 doesn't consider it to be a controller CFC (since you would only extend this, not use it directly as a controller). You could also place it in a subfolder of the controllers folder and, again, FW/1 would ignore it.