UPDATED: The functionality has now been rolled into the framework as of version 1.2, so the hack is unnecessary. The methodology for overriding a framework method still applies, but let me reiterate: be very careful what you change, and look out for any code changes to the overridden method in future releases!
Original post continues below...
My (first) FW/1 application consists of two subsystems: public and admin. The public subsystem is the default, so if I invoke a URL action without a subsystem specified explicitly, it will use 'public'.
Of course, if you use the buildURL() method to create your links (which you should be doing!) it will always prepend your action with public: - which I find a little untidy, especially when using SES URLs.
Read more »
Posted on 26 August, 2010, in
ColdFusion, FW/1
I've only recently started using cfscript to code my components, and today ran into this little problem...
I have an Application.cfc, written in cfscript, and I want it to include a settings file which contains the different settings between development and production servers (so I can update the Application.cfc file without having to worry about altering settings before copying it to the live server).
Read more »
Posted on 22 August, 2010, in
ColdFusion, Quick Tips
In my CF9 ORM application, I have a magazine object. Each magazine has a single genre (e.g. Craft, Sports, etc.) - so I have a many-to-one relationship set up on the magazine.cfc:
component output="false" persistent="true"
{
// identifier
property name="magazineid" fieldtype="id" setter="false" generator="identity";
// properties
property name="title";
property name="genre" cfc="genre" fieldtype="many-to-one" fkcolumn="frn_genreid";
}
The genre.cfc looks like this:
component output="false" persistent="true"
{
// identifier
property name="genreid" fieldtype="id" setter="false" generator="identity";
// properties
property name="genre";
property name="magazines" cfc="magazine" fieldtype="one-to-many" fkcolumn="frn_genreid";
}
It all works nicely, until I want to try removing the genre from the magazine.
Read more »
Posted on 18 August, 2010, in
ColdFusion, ORM
Just a quick tip for anyone using FW/1's populate() method to populate their objects.
I ran into a problem where my auto-generated setters were being called correctly by the populate() method, but my explicit setters were not. And because FW/1 ignores any error generated here, I couldn't work out why this was...
Read more »
Posted on 15 August, 2010, in
ColdFusion, FW/1
My new project is using CF9's ORM, FW/1 and ValidateThis, all for the first time - so naturally I'm having to work a few things out. There will probably be a few posts like this one over the next few weeks...
I have a user edit page, on which you can edit your personal details and change your password. It's set up something like this:
Read more »
Posted on 15 August, 2010, in
ColdFusion, ORM, ValidateThis