I encountered a problem when using PHP chain calls:
There is a class "Site" below:
api = new Api(); return $this->api; } } ?>
There is also a class "Api" located in "class.Api.php":
Use the following code to instantiate:
$site = new Site();
Call the following code again:
$site->api()->auth(); $site->api()->render();
Will PHP repeat require() and create new object API? If so, require() can be replaced by require_once(), but how to make "$site->api()" return the same object? Thanks!
Single case mode.
It’s just a simple writing, but it still needs a lot of optimization.