Anybody knows how to create a View and a Model with Prometheus Module ?

suntaifook35's picture

I need to use MVC pattern on the project where Im working, so I installed Prometheus ...

The problem is that there is no good documentation which explain how to create views and modeel..

Can someone help me?


Rad project. Never heard of

R.J. Steinert's picture

Rad project. Never heard of it before. I'll need more proof it's worth it before I dive in. The fear is that it will make development harder than not using it because it requires you to build, at a very base level, code that is Prometheus specific. In other words, if the being put in the Prometheus box is stable then cool, if not then why bother?

Views and a Model

beyondcreed's picture

Hi suntaifook35,

Prometheus uses templates that reside in your theme_directory/templates for final view rendering ( full page mode, e.g. templates/show.tpl.php, templates/show/something.tpl.php, etc. ) or templates that Drupal picks automatically depending on what is being accessed ( region mode, e.g. page.tpl.php, node.tpl.php, etc. ). These are automatically mapped unless you override it. There are two output modes ( page or region ). In addition to this also there is JSON view as well ( which can return serialized JSON data ). Model logic can be embedded right into the controller class ( where the dispatching occurs ) or you could place it into it's own separate class and load this from controller class. This is an area that is currently evolving as next release will have support for auto loading. Also check out for more documentation and code examples. And you can also download archive file containing the whole website which should have quite a few examples. There is another youtube video showing a quick start as well. We would like to get more contributors that can help out with the documentation and code examples, if you feel like doing this please let me know. We can always help you with what you are trying to do.

We are also on #drupal-prometheus. Feel free to drop in for realtime support.

rjsteinert, Prometheus actually works in conjunction with existing Drupal mechanisms such as hooks, theme registry and so on. When using Prometheus you can build custom functionality for a website using a single module and number of classes, this drastically reduces bootstrap time and allows you to work with OOP paradigm. Development is actually much easier with Prometheus then by writing a custom module yourself. This is because lot of things are handled for you automatically, under the hood. Code is stable and we have deployed it already on number of production websites. Any code can be specific to something ( even you use any of the contrib modules ), so I was not sure what you meant by that comment. Prometheus is just another way to develop websites with Drupal by offering concepts familiar to people who come from MVC frameworks.

Alex Pavlovic - Founder / CEO / Developer
DevRadius Inc.
Drupal Development and Cloud Hosting