coldbox create app help
command and get help for the creation command.ls
command to view them.--rewritesEnable
flag will turn on some basic URL rewriting so we have nice, pretty URLs.main/index
view. It's located int he views
folder.prc.welcomeMessage
variable we set in the controller.helloWorld
with actions index
, add
, edit
, and list
. The command also created a test case for our handler as well as stubbed-out views for each of the actions.?fwreinit=1
at the end of the URL.127.0.0.1:43272/helloWorld
index.cfm
before the /helloWorld
bit, but our --rewritesEnable
flag when we started the server makes this nicer URL possible.cbmessagebox
from the CommandBox prompt like this:list
command.coldbox
and cbmessagebox
to run. We'll use our new cbmessagebox
module in a few minutes. But first, we'll create a simple Model CFC to round out our MVC
app.GreeterService
in our new app with a sayHello
method.--open
is a nice shortcut that opens our new model in our default editor after creating it.sayHello()
method by adding this return statement and save the file.singleton
to the component declaration. This will tell WireBox to only create one instance of our service.new
or createobject()
for CFCs anymore.helloWorld
handler we created a while back. Remember, you can hit tab while typing to auto-complete your file names.greeterService
and the cbmessagebox
service into the handler by adding these properties to the top of /handlers/helloWorld.cfc
.variables
scope of other objects. This makes your life easier as you don't have to be creating objects manually or even knowing where they exist.variables
scope where we can access it in our action methods.index
method, we'll set the output of our service into an info
message.layouts/Main.cfm
and find the #renderView()#
. Add this line right before it to render out the message box that we set in our handler.helloWorld
handler one final time with ?fwreinit=1
in the URL to see it all in action! (Again, your port number will most likely be different.127.0.0.1:43272/helloWorld?fwreinit=1