Questions tagged [cfwheels]

CFWheels provides CFML developers with a rapid MVC framework for increased productivity, organized code, and overall developer happiness.

CFWheels

CFWheels provides CFML developers with a rapid MVC framework for increased productivity, organized code, and overall developer happiness.

CFWheels is heavily based on Ruby on Rails, but it's not a direct port, and there are some things that have been changed to better fit the CFML language. The goal is to keep things simple and this shows in a lot of different areas in CFWheels.

Key CFWheels Concepts

1. Convention Over Configuration

Instead of needing to set up tons of configuration variables, CFWheels will just assume you want to do things a certain way by using default settings. In fact, you can start programming a CFWheels application without setting any configuration variables at all!

2. Beautiful Code

Beautiful (for lack of a better word) code is code that you can scan through and immediately see what it's meant to do. It's code that is never repeated anywhere else. And, most of all, it's code that you'll enjoy writing and will enjoy coming back to 6 months from now.

3. Model-View-Controller (MVC)

If you've investigated frameworks in the past, then you've probably heard this terminology before. Model-View-Controller, or MVC, is a way to structure your code so that it is broken down into three easy-to-manage pieces:

  • Model: Just another name for the representation of data, usually a database table.
  • View: What the user or their browser sees and interacts with (a web page in most cases).
  • Controller: The behind-the-scenes guy that's coordinating everything.

4. Object Relational Mapping (ORM)

The Object Relational Mapping, or ORM, in CFWheels is perhaps the one thing that could potentially speed up your development the most. An ORM handles mapping objects in memory to how they are stored in the database. It can replace a lot of your query writing with simple methods such as user.save(), blogPost.comments(order="date"), and so on.

161 questions
2
votes
2 answers

Different rewrite mode for CFWheels website root

I need an advice on researching the following issue. Wheels website has set(URLRewriting="On") configured, everything looks fine except root page. All links built with linkTo look like website.tld/controller/action. But on a / mode "switched" into…
Sergey Galashyn
  • 6,946
  • 2
  • 19
  • 39
2
votes
1 answer

Running a CFWheels site from a subfolder instead of the web root

My CFWheels site is running under subfolder/ in the web root, and I have the web.config on the same level as subfolder/. In my web.config I have the necessary URL rewrite rule to remove "subfolder/index.cfm/" from the URL. My problem arises when I…
Riley Watkins
  • 3,453
  • 3
  • 25
  • 19
2
votes
2 answers

Using the request scope to store an object

I'm using CFWheels to develope an application in ColdFusion. I have a model called Vote.cfc. Before a Vote object can be created, updated, or deleted, I need to fetch a post object from another model: Post.cfc. A Vote belongs to a Post. A post has…
Mohamad
  • 34,731
  • 32
  • 140
  • 219
2
votes
1 answer

Difference between including a template in cfc and extending it

I thought that one should extend .cfc components, but I am reading the cfwheels framework source where I see something like this:
user3733648
  • 1,323
  • 1
  • 10
  • 25
2
votes
1 answer

Create subdomain for each user that signs up

I am developing a project in Coldfusion with CFWheels MVC Framework with URL Rewriting enabled. It involves user registration and each user should be presented as username.domain.com instead of www.domain.com/users/username. Moreover once I am on…
Alfredo
  • 21
  • 1
2
votes
0 answers

CFWheels: MVC include partial error: Could not find the included template

I'm pretty new to CFWheels, and I guess the answer to this question may be pretty obvious, but please bear with me. I'm trying to include shared/loginregister as a partial on my layout page. However, I keep getting this ColdFusion error: Could not…
2
votes
1 answer

CFWheels: Map table to another database Database.tablename

I have a datasource called "cforms" which has access to two database "cforms" and "cquizes" I wish to create the following query: select * from cquizes.tb_depts; I have a model for table "tb_depts":
Saad A
  • 1,135
  • 2
  • 21
  • 46
2
votes
2 answers

CFWheels ORM and SQL Injection

I am new to Coldfusion and my previous background is in PHP using codeIgniter. I am currently using CFWheels for a project. I have a insert statement n_building = model("buildings").new(); n_building.name = name; n_building.save(); And read…
Saad A
  • 1,135
  • 2
  • 21
  • 46
2
votes
1 answer

Using Model to establish inner join between tables

I'm trying to set up a relationship between two tables, articles and categories. It is a 1-to-1 relationship where articles.category_id = categories.id. I have the following set up. controllers/home.cfc
justacoder
  • 2,684
  • 6
  • 47
  • 78
2
votes
1 answer

Where should we write validation code for a form in cfwheels?

I have just started learning cfwheels. I was working on the sample "Social Networking Site" example present in the site(http://cfwheels.org/screencasts/series/1). I have a doubt. We have register.cfm and login.cfm two views present. Both the veiws…
Deepak Kumar Padhy
  • 4,128
  • 6
  • 43
  • 79
2
votes
1 answer

Cfwheels Element plugins is undefined in a CFML structure

I have an issue where I am receivng "Element Plugins is undefinied" error. I am using cfwheels v1.3 on Coldfusion 10. The thing is that it works perfectly on my local machine which is using coldfusion 11 but has the exact same codebase. This is the…
matthew
  • 703
  • 2
  • 9
  • 24
2
votes
4 answers

Static pages in MVC framework?

Where do you guys put your static pages, like "home", in an MVC framework? Do you have a "home" controller? A "pages" controller? Do you create actions for each static page? I'm using CFWheels now, and I'm trying to figure out the best place to put…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
2
votes
1 answer

How to check whether code will work on CF9 server while working on CF10 server?

I have installed CF10 server installed on my local machine. We are migrating from CF9 to CF10. We use CFWheels framework for development. There are certain projects which are still on CF9. I would like to know, is there any way to check whether my…
Tushar Bhaware
  • 2,525
  • 1
  • 16
  • 29
2
votes
0 answers

D3.js Chord Diagram works on local server but not remote

I've got a chord diagram adapted from https://gist.github.com/1308257/1b67569b598525efad854978eced78ee74eec158 . On my version, it works perfectly on my local box (Apache, CF9) but when uploaded to the main box, (IIS6, CF8) I get "Unexpected value…
Neokoenig
  • 1,102
  • 7
  • 16
2
votes
2 answers

CFWheels - Calculated property generates column error in query

Ok, so this is really confusing me now, because I had this working a while back and something has changed which has caused my calculated properties to not work. I have a "page" controller that does a findAll() on the "link" model. This works great,…
Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140
1 2
3
10 11