Welcome Guest, Not a member yet? Register   Sign In
Presentation Model
#1

[eluser]taviroquai[/eluser]

Hi all,

I really like Drupal Blocks where the user can configure blocks to fill layout/template slots.

There are basically 4 entities to accomplish this:
1. Module - some code igniter model that can be reused.
2. Block - block is like an abstract Module that will be put in slots
3. Slot - a space in the layout/template that can be filled with blocks.
4. Layout - it will render the final view, putting all this bits together

Now, I have this working... I can configure blocks on the database and I have a layout model that puts all this together and render the final view. To be reusable in any controller, this layout entity is a Model... I'm not sure if this is the right way to do it... I see this Model has a Presentation Model. The problem with this approuch is that, in this model I have a "render" method that loads other views which is against MVC approuch...

How would you do it? Whats the most correct way to organize this?

Thank you.
#2

[eluser]InsiteFX[/eluser]
Use a library and access your model from the library etc.




Theme © iAndrew 2016 - Forum software by © MyBB