mario
284446 years ago
A PHP framework (MVC) in 400 lines of code?
Is anybody aware of a (working) minimalist MVC framework/library for PHP whose source code is 300-400 lines or even less?
Clearly I am thinking about a truly minimal one, here:
- urls handling
- a basic architecture for controllers
- php templates
- ego-free
- hype-free
- does nothing beyond MVC
Nothing spectacular; I am after something that is more an alternative to vanilla PHP than an alternative to other frameworks.
mario
284097 years ago:
I was thinking about this idea a little more.
After having built my personal "lightweight" MVC framework (8,000 lines) and having used it on some mid-sized projects (including glorum), the idea of a truly essential MVC framework begins to show some appeal to me.
With the development I typically do, most of the saving in web development effort I get from an MVC framework comes from the MVC architecture, not from the framework itself.
The convenience of using an MVC architecture to me is substancially a much delayed and lighter refactoring.
To look at it in another way, I can have "prototypes" which are not that bad. They have a reasonable organization at no cost.
When I start a project, I can have a reasonably precise idea about how many files I need, what folders, where to put what, how to name things.
Even when I need to reorganize things, it often tends to be a much more trivial effort than it would have been with another type of architecture.
Less appealing, but still important, I am enjoying some *unplanned* reusability of controllers, templates and models. Again, it looks like it is coming from MVC, not from the framework.
Here is the big idea: I don't need 8,000 lines of code if I only want that.
The problems you would solve with a small framework that provides most of the value of a big framework are too many to list.
stiian
283852 years ago:
I've also got a need for a minimalistic mvc framework. This stage, the best I've came across was Code Igniter (www.codeigniter.com), but is still way too big. I basically need a GOOD "starting point" with base objects for models, views and controllers, then work from there and build on it using my own modules.
mario
283718 years ago:
Exactly what I am thinking about, stiian. Being able to cleanly build on it is the key.
Something of that kind could maybe allow a small family of domain-specific frameworks and CMS with a common core to be developed.
A pear-like library developing around a very light framework would be interesting, too.