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
https://forums.phpfreaks.com/topic/17960-oop-programming/#findComment-76867
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.