This question concerns merely ThinkPHP programmers.
So there are Model
and D()
in ThinkPHP. A model is very useful to communicate with the DB. But when we use D()
to create a Model
then find a piece of data. actually what we get is a array.
Then how can I get a instance that is of a class and has methods to use. To build methods in the model seems useless.
Should I have another class apart from the model, for example UserModel.class
+ User.class
?
Below is what I thought out.