Box Mastery Flashcards
Command to create a new ColdBox app with quick and authentication.
coldbox create app skeleton=cbTemplate-quick-with-auth
Command to remove CRSF interceptor
uninstall verify-csrf-interceptor
Command to populate a new .env file
dotenv populate –new
Command to start a new server running the latest of Lucee 5
server start cfengine=lucee@5
Command to install migrations table using commandbox-migrations.
migrate install
Command to create a migration
migrate create create_some_table
Command to run migrations
migrate up
By convention, QuickORM places models in what folder?
models/entities
Component to extend when creating Quick entity
component extends=”quick.models.BaseEntity” accessors=”true” {}
How to define column alias in QuickORM.
property name=”body” column=”somealias”;
How to override model key in QuickORM
variables._key = “SOME_COLUMN”; // add to each model
Handlers by convention are __.
plural
Set the default event in ColdBox
In ColdBox.cfc:
coldbox = {
defaultEvent=”Handler.action”
}
Get a single Post entity with Quick
getInstance( “Post” ).findOrFail( rc.postId )
Get all Post entities with Quick
getInstance( “Post “).all()
Get the first Post entity where title=’sometitle’ with Quick
getInstance( “Post” )
.where( “title”, “sometitle”)
.firstOrFail()
You need to __ when making a model change.
?fwreinit=true
Limit words to 30 characters within Quick model
return variables._str.limitWords( text, 30 )
Define GET route in Router.cfc
get( “/some/route”, “Handler.action”);
Define GET and POST for a single route in Router.cfc
route( "/some/route") .withHandler("someHandler") .toAction( { GET: "index", POST: "update" });
Set the view in a handler
event.setView( “dir/view” );