Thomas Müller
Thomas Müller

Reputation: 1433

How would you setup a small MVC structure?

In a few weeks, I will guide some of our trainees through a customer project, where they have to build a small web application in php. My idea is to setup a small MVC structure for them to learn oop and mvc and to assure code quality. How would you do this? We have no special requirements, just php and mysql. Would you use a template system like twig or just use phtml files like magento does? Would you use some ORM like propel oder just pdo? Any suggestions welcome.

Upvotes: 2

Views: 3252

Answers (2)

Leander
Leander

Reputation: 11

Consider using https://github.com/leanderlee/Emvisee. I use it for most of my projects because it basically works right out of the box, and it uses twig, which is really awesome for templating. The controllers and everything are very intuitive.

Upvotes: 1

Sarfraz
Sarfraz

Reputation: 382646

Here is an excellent startup tutorial on MVC structure at phpro.org:

Would you use a template system like twig or just use phtml files like magento does?

Above tutorial uses a method for templating system. But you can also modify/improve the templating mechanism as per you needs that you think is more flexible.

Would you use some ORM like propel oder just pdo?

For serious mvc framework development, it is better to use them. But for educational purpose that isn't a requirement but an additional step if you want to take.

Upvotes: 2

Related Questions