Can I to do some query to the database from view?

Topics: Customizing Orchard, General
Nov 22, 2011 at 12:05 PM

Hello!

Can I to do some query to the database from view?

Thanks!

Nov 22, 2011 at 2:04 PM

It's not advised - that's the whole point of the MVC separation between model and view. If you need extra data in the view you should pass it from the controller (or from the driver if you're working with content parts).

Coordinator
Nov 24, 2011 at 1:44 AM

You can, but every time you do, a kitten is sacrificed.