Driver vs. Controller

Topics: Writing modules
Mar 29, 2011 at 6:23 PM

Can someone tell me the difference between a controller and a driver? When to use which one?

Thank you

Mar 29, 2011 at 9:10 PM

A controller acts at the whole request level, whereas a driver acts at the content part level.

I posted a detailed explanation of what happens when you navigate to a page here:

Mar 30, 2011 at 5:57 PM
Edited Mar 31, 2011 at 3:44 PM

Even though your controller acts at the whole request leve', you can still have the html you return be wrapped with the theme of your website by applying the [Themed] attribute to your controller. For reference, look at the Hello World example: