Jump to content

MVC Modules


Recommended Posts

This might sound like i'm stupid, but bare in mind i'm 80% front end dev.

Now I know PW works on hooks, but is it possible to use MVC structure when building plugins??

In a way i'm just curious as to the general architecture of PW and what's possible. ( in the sense of can i grab some MVC built functionality elsewhere and plug it into ProcessWire? )

Any help getting my head around this would be great :)

  • Like 1
Link to comment
Share on other sites

On the general question of 'using MVC' in PW, there have been a number of thoughts...

 
 
As for your plugging in MVC-built functionality from elsewhere, that seems to be a separate question - about bootstrapping other applications in PW. That is possible, but you might have to contend with variable, etc. collisions, hence the need for namespacing. Others with a better grasp of this will chime in :-)
  • Like 2
Link to comment
Share on other sites

I have a hard time understanding what people mean by "MVC" sometimes, but it seems to me that the PW module system is natural for building this way. You can set the module to autoload and then use it as your Controller. Keeping all your logic in there, the template then becomes your View, and the Pages API already handles the Model side of things.

But I could be totally wrong...

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...