vic vance Posted October 25, 2011 Share Posted October 25, 2011 I have been away from PHP for a long time and I was looking over my old scripts. I did PHP OOP at one time and I used a paticular method to connect all my methods up and load them. I have been looking at other peoples code and when I look at my code it does not even feel like OOP, I want to know how to you link all the methods (or is it called functions?) in a class up and return them? I use to do this: <?php class quickFUNC { function note_pad() { // code for notepad } function quickAdminFunc() { // code for admin func $this->note_pad(); } } $quickFUNC = new quickFUNC; if(isset($_GET['id'])) { $act = $_GET['id']; } else { $act = NULL; } switch ($act) { case 1: //some random code to launch case 1 break; default: $quickFUNC ->quickAdminFunc(); ?> This was my code back in the days, as you can see the notepad was called in the admin function then made the admin function default in the case switch. I looked at all my script and the all are layed out like this :S.. Can I get some help please, thank you. Link to comment https://forums.phpfreaks.com/topic/249811-question-in-oop/ Share on other sites More sharing options...
shlumph Posted October 25, 2011 Share Posted October 25, 2011 I'm not really sure what you're asking. To start, think of classes as nouns. And functions are behaviors for that noun. I'd recommend reading this: http://www.phpfreaks.com/tutorial/oo-php-part-1-oop-in-full-effect Link to comment https://forums.phpfreaks.com/topic/249811-question-in-oop/#findComment-1282241 Share on other sites More sharing options...
MasterACE14 Posted October 26, 2011 Share Posted October 26, 2011 Make sure you understand the five basic concepts first: ICAPE - Inheritance - Classification - Abstraction - Polymorphism - Encapsulation Link to comment https://forums.phpfreaks.com/topic/249811-question-in-oop/#findComment-1282287 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.