search

Home  >  Q&A  >  body text

About linking the database before using the model in tp5

It is known that the model in tp5 can automatically associate a data table, provided that the database where the table is located has been connected. Please tell me, in addition to configuring the database information in database.php, can I connect to the database in the model file? Yes. What if you define the link function in the class and then call the function in other files?

phpcn_u187094phpcn_u1870942446 days ago963

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2018-05-02 10:25:40

    Look at the manual, this one has an introduction

    reply
    0
  • Cancelreply