Jump to content

OOP programming


avo

Recommended Posts

Have you tried googling it? I found a few possible sites with a quick check. If you have never programmed in an OO environment, it can take some adjustment to move from procedural to classes and methods. I'd recommend looking into OO in general, and then starting to apply it to your php.

Java has a relatively decent explaination of the topic: http://java.sun.com/docs/books/tutorial/java/concepts/

For php, the standard syntax is:

[code]class ClassName [extends ParentClass] {

    function className ($param1, ...) {
        //this is your constructor, where you set the value of variables
    }

    function functionName ($param1, $param2, $optionalParam = 'defaultValue') {


    }

    /* keep listing more and more functions */

}[/code]
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.