开发者

Call function inside __construct with php

开发者 https://www.devze.com 2023-03-16 22:16 出处:网络
A simple PHP problem I couldn\'t find the answer to. Is it possible to call a function from the \"__construct()\"?

A simple PHP problem I couldn't find the answer to.

Is it possible to call a function from the "__construct()"?

For example if I use the My_Controller solution here. If I add my own functio开发者_JAVA技巧n below, like if I have a more advanced auth, can I call it from the construct?


Yes, using the format $this->myNewFunction();

0

精彩评论

暂无评论...
验证码 换一张
取 消