1
I know that most PHP frameworks are used by default MVC
. Where thing guy (theoretically) should stay in his particular place.
For example, the controllers are responsible for the request and other things, the models are the database abstractions, and the view is the view layer.
But I’ve seen some programmers who do, for example, queries using the model within the visualization layer.
An example:
@foreach(Estado::where($usuario->estado_id)->where('status', '=', 1)->get() as $estado)
<div>{{ $estado->nome }}</div>
@endforeach
I notice it gets very disorganized when it occurs.
So I want to know if, taking into account the MVC standard, this is a bad practice, or it can be considered an error on the part of the programmer?
Is bad.........
– Maniero
It is bad.. Sometimes it happens for example to compare variables with constants and etc.. but in this case it showed.. it is clearly an error
– Fábio
Taking into account the MVC standard, because without taking this consideration, it would be based on opinions.
– Wallace Maxters
It is PHP and Laravel error that, without crying :P
– rray
Error you speak because it allows it to happen?
– Wallace Maxters
Cakephp, on the other hand, can’t do a thing like that
– Wallace Maxters