I am just creating one class related to image upload and i was thinking to start it's object on end of the line of class that user can simply include it into file and execute it directly
Asked
Active
Viewed 23 times
1
-
Do you have a class which you only want one instance of? If so, take a look at [singletons](https://stackoverflow.com/questions/203336/creating-the-singleton-design-pattern-in-php5). – PeterMader Jun 08 '17 at 12:06
-
No i was just thinking to call that class's object on the same file that user can directly call that object in that file after including that class file. – Jun 08 '17 at 12:12
1 Answers
1
I think it's better to create your upload image class with static function. So you never need to create object and you could include it in other class, whenever you want.
You could access your function as:
UploadImage::upload($destPath)

sathish R
- 402
- 4
- 8