I have a few questions:
1 Shouldn’t $user, the automatically loaded construct, be empty?
is to call $this->user->name in the hello method, so what you get is also empty.
Why is it written like this?
The parameter of the constructor method is required to be a userModel object. If this object has the attribute name, it can be $this->user->name.
An error will be reported. In the construction method, did you pass user in the new object (did you pass it in)?
The parameter of the constructor method is required to be a userModel object. If this object has the attribute name, it can be $this->user->name.
An error will be reported. In the construction method, did you pass user in the new object (did you pass it in)?