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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.