hello.cfcinside of the
hello.indexoutputted to the screen. You have now created your first handler and view combination. However, how did this work? It works as ColdBox by convention creates another agreement with you on how to execute events, default URL routing.
config/Router.cfc. It will include a few default routes for you and the following default URL route:
:actionportion denotes that the action might or might not exist in the URL. If it doesn't exist, then another convention is in play, the default action which is
index()which receives three arguments:
rc- A struct that contains both
URL/FORMvariables (unsafe data)
prc- A secondary struct that is private only settable from within your application (safe data)
hello.cfc) and method that was generated
index(). By convention, this is how you execute events in ColdBox by leveraging the following URL pattern that matches the name of a handler and action function.
actionis defined in the URL then the default action of
indexwill be used.
config/Router.cfcwhich is your application router.
/views/virtual/hello.cfm) and add the following:
Hello From ColdBox Land!displayed! This is a great way to create tests or even bring in legacy/procedural templates into an MVC framework.