Driver vs. Controller

Topics: Writing modules
Mar 29, 2011 at 5: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 8: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 4:57 PM
Edited Mar 31, 2011 at 2: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: