Jump to content

Question in OOP


vic vance

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.