php - automatically create an instance of myClass

DDeath

New Member
I have a class called myClass in /myDir/myClass.php. When user types url:\[code\]http://mysite.com/myDir/myClass.php, \[/code\]I want to automatically create an instance of myClass. What technique can I use to do this? the idea is to use myDir directory as top level of programs that user can call directly, but I don't want to add \[code\]instance_of_myClass = new myClass();\[/code\] because then I won't be able to extend the class. Does this make sense?\[code\]class myClass{ __construct() { echo "hello World"; $this->myClass_report(); } myClass_report() { // some code here }} \[/code\]
 
Back
Top