redirecting to other methods when calling non-existing methods

后端 未结 3 833
甜味超标
甜味超标 2021-01-14 16:18

If I call $object->showSomething() and the showSomething method doesn\'t exist I get a fata error. That\'s OK.

But I have a show()

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 17:16

    Not necessarily just the show.... methods, but any method, yes, use __call. Check for the method asked in the function itself.

提交回复
热议问题