Small projects

Hi can I ask , how can I use mvc in small projects without using frameworks.

Thank you in advance.

Here is a good tutorial on that: https://symfony.com/doc/current/book/from_flat_php_to_symfony2.html
Yeah, this is Symfony’s documentation but that particular tutorial describes very general idea about how to switch from flat PHP to MVC in small blog application.

3 Likes

Slightly OT, and I’ve not had chance to read the article yet, but is it the sort of thinking you could apply to plain vanilla JavaScript?

1 Like

I’ve seen people use lightweight frameworks to some success too, either as a base for their own MVC projects or to more easily learn MVC without all the bells and whistles of larger, fully featured frameworks.

But it’s still a framework, just a small bare-bones one.

Yes, absolutely. The article takes a single PHP script where all the concerns are mixed together, and separates them out one at a time to leave you with code that is more reusable, maintainable and easier to reason about. The principles apply to JS as much as to PHP (or any other language). All most frameworks are basically doing is saving you from having to create the basic structure to do this every time you start a new project.

Thank you for the reply :smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.