search

Home  >  Q&A  >  body text

__construct method in thinkphp5.1

In thinkphp5.1, do the parameters passed in the __construct method must have default values?

The Container class always reports an error without default parameters

乘风破浪乘风破浪2281 days ago1158

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2019-01-24 11:28:21

    This is controlled by the programmer himself. If you do not pass in parameters when instantiating the container class, you should set a default value for these parameters, which is not mandatory

    reply
    0
  • Cancelreply