search

Home  >  Q&A  >  body text

God asks for solution

protected $pk = 'user_id';What does it mean

…………2071 days ago1495

reply all(7)I'll reply

  • Icetalker

    Icetalker2019-03-25 15:51:30

    $pk here defines the primary key of the model associated with the data table

    reply
    0
  • XUE伟健

    XUE伟健2019-03-24 21:24:02

    protected Protected is this $user_id. You can call it but you cannot assign it to change it. and public (representing public), and one called private, the first two of which can be inherited

    reply
    0
  • ……

    God, I have another question

    …… · 2019-03-24 21:25:27
    ……

    Since it needs to be associated with the user table of the database in order to be added, TP5 has already done the processing internally and only needs to create a new application/index/model/User.php file. Did he say that he should go to TP5 to handle it himself?

    …… · 2019-03-24 21:27:15
    ……

    Failed to load resource: the server responded with a status of 500 (Internal Server Error) He gave me this reply

    …… · 2019-03-24 21:28:15
    Icetalker

    Don't mislead, protected means that it can only be called or assigned within the class or subclass, not that it cannot be assigned.

    Icetalker · 2019-03-25 15:47:37
  • Cancelreply