jHertel has already given a brief introduction to what MVC is, some questions that can help you about this specifically:
From my summary point of view, MVC does not have a specific standard, in fact in many ways you can make use of it and achieve the same result, being strict or not, inphinit is not strict, truth is very "free", with the exception of Controllers
which are almost always required (although it supports Closures
/ a>).
So the MVC is a way to organize and not a technology, from my point of view, the most common MVC represented is this:
Inheritfollowsmanythingssimilartootherknownframeworks,withthefolderandnamespacefor
Controller
and
Model
(
View
hasnonamespace),thisclassyoupostedwasoneoftheexperimentalexamplesyouweredoing:
<?phpnamespaceModel;classUserextends\Inphinit\Experimental\Model{}
AtthemomentIremovedtheclass\Inphinit\Experimental\Model
,notbecauseitiswrong,butbecauseitstilldoesnotachievewhatIexpect,frommypointofview,Modelshavenothingtodowiththedatabase,theyonlyusethedatacontainedinthem,ThepurposeoftheModelistodefinethe"business rules", thus making use of any type of information, having the ability to obtain them, update and delete, but all this having rules.
However, I believe that a Model, wherever it is, should never manipulate things directly, type send data to ouput, or send response, it should only send the response (if any) to the controller and the controller should take care of it. rest (of course I rely on this with the experience I had with totally different tools, as MVC said is not always the same in two different places or frameworks).
In most frameworks I notice the Model is used merely as a tool for connecting to the bank, and some rules end up falling within Controller
.
When I designed inphinit it had 5 goals:
Support PHP 5.3
Spend as little memory as possible
Be as fast as possible without there being many cycles within the kernel.
Being as simple as possible for learning
Support thirdparty libraries that are installed via composer
With this last goal we have reached namespace Model;
and the system/application/Model/
folder, the framework does not have anything like migration , connection and sqlbuilder , but this does not mean that you can not install third-party stuff, there are frameworks that I've even used with it like:
In other words, the focus of the folder and namespace Model
is the same as that of most frameworks, however you can use the ORM you want or as desired >
As soon as possible irie add a step-by-step one or more frameworks to work with the namespace Model
.