Peter Amiri
02/01/2022, 1:47 PMPeter Amiri
02/03/2022, 3:49 PMbox
mkdir testURLFor --cd
install cfwheels-template-hellopages
Now start your server. You'll see a page one that has some links to page two which has some links to page three and then back to one. There are three sets of links on each page, the first uses a named route, the second specifies just an action, and the third specifies the controller and action. You'll see this links work fine and you can navigate to the next page using any of the links. Now go to your address bar and specifically go to /index.cfm/wildcard/one
you'll see a similar page with links to get you to the next page. I turn the first link into a static text cause we don't have named routes for the wildcard controller. Now you see the wildcard links are broken. They only contain the controller name. It's not the routing engine cause you can go to the address bar and enter /index/wildcard/two
and /index.cfm/wildcard/three
and the proper page comes up but the link that are built by the LinkFor() function are broken.
Now go into /wheels/global/misc.cfm
and comment out the else if block on line 669-672. Now reload your app and visit /index.cfm/wildcard/one
and you'll see the wildcard links built by specifying only the action or the controller and action now work.Peter Amiri
02/04/2022, 10:04 PMwheels create app
command and modified the wheels NEW
command to remove the bootstrap options. I've also got three templates posted to ForgeBox and worked with Brad Wood to create a new CFWheels Templates type/grouping in the listing.Peter Amiri
02/07/2022, 7:50 PMwheels generate app
wheels generate app-wizard
The app-wizard runs the user through menus and passes the parameters gathered to the app command. These commands can obviously be shortened to:
wheels g app
wheels g app-wizard
The app-wizard command also has an additional alias:
wheels new
Peter Amiri
02/11/2022, 2:45 PMPeter Amiri
02/12/2022, 5:00 AMPeter Amiri
02/17/2022, 8:56 PMwheels g app template=cfwheels-template-example-app --setupH2 name=exampleApp datasourceName=exampleApp directory=exampleapp
Then start the server:
start
Once the server starts up, you'll have to install the H2 extension:
install
Then after a minute, you can run the migrations:
wheels dbmigrate latest
I've also put in an installation check page so the users don't get CF Engine errors during the process.Peter Amiri
02/17/2022, 9:12 PMAdam Cameron
validate
method (https://api.cfwheels.org/v1.4.5#validate)... this allows one to set validation handlers to be called when validations happen.
Do they occur before, after, or instead of CFWheels' built-in-based-on-the-DB-schema validations? I don't see comment one way or the other on https://guides.cfwheels.org/docs/object-validation.
Context: I have a property that is backed by a nullable date in the DB. By the time one of my bespoke validation handlers is called, will the inbuilt validation already have pushed back if the passed value is "slartibartfast"
(or some other non-date value), or does my handler still need to guard against it being a date? I am presuming validation fails could be a cumulative thing, so I do need to guard against it.
In this case I at least have to do a null-check before I do anytime timeframe validations on the value, I guess.Adam Cameron
jumpmaster
03/09/2022, 1:43 PMAdam Cameron
public void function $addToCache(
// ...
) {
// ...
for (local.key in application.wheels.cache[arguments.category]) {
if (Now() > application.wheels.cache[arguments.category][local.key].expiresAt) {
Seems to me like there's no guarantee that application.wheels.cache[arguments.category][local.key]
will still be there when you come to assume that it does.Adam Cameron
/
route by default there is a link "View and code along with our "Hello World" tutorial.". This goes to https://guides.cfwheels.org/v2.2/docs/beginner-tutorial-hello-world, which 404s.Adam Cameron
Adam Cameron
https://i2.paste.pics/ec0a9486a50268b595d2dbf303bb3cf9.png▾
djuggler
03/22/2022, 9:44 PMAdam Cameron
$
as a prefix to method names in CFWheels. It seems to me that this is used in lieu of actually making a method private. The only reference I have been able to find for this in the docs is a mention in passing:
If you have functions that should only be called from the plugin itself, we recommend starting the function name with the(my emphasis, and that is from https://guides.cfwheels.org/docs/developing-plugins#using-a-plugin-to-add-or-alter-capabilities) I could find no other explicit explanation, butcharacter (this is how many internal Wheels functions are named as well)$
$
is hard to google for, so this means nothing. I didn't find anything further searching for "private" or "internal" either, that said.
I want code to run every time a model object is created. Normally I would put this in the constructor of the class, but for reasons that I cannot fathom, CFWheels does not call init
when it creates an object. So that's no good.
I have found $createInstance
in wheels.Model
, and if I override that in my own models, it seems to work as I'd expect. Certainly when I call new
/ findOne
/ findAll
on the model factory object, it seems to be called on the returned model object(s).
However I am cautious that it's a method prefixed with $
, therefore "internal" to CFWheels. I should probably not be messing with it, or calling it directly (even in an overridden implementation of itself).
So is there a more CFWheels-idiomatic way of doing this? Or am I fine with this approach?
Cheers.Adam Cameron
risto
03/31/2022, 9:16 PMPeter Amiri
04/10/2022, 9:07 AMPeter Amiri
05/10/2022, 3:16 PMPeter Amiri
05/16/2022, 11:42 PMPeter Amiri
05/17/2022, 5:37 PMmike42780
05/25/2022, 3:51 PMDavid Belanger
05/25/2022, 8:44 PMAndreas
06/05/2022, 10:40 PMPeter Amiri
06/06/2022, 12:04 PMBrian Lang
07/07/2022, 10:15 PMPeter Amiri
07/07/2022, 10:21 PMPeter Amiri
07/07/2022, 10:24 PM