First let me say that I am in the same boat as you are; in fact, I have never coded anything in an OOP level. Though I have read like a million articles, I still have a vague idea of how to write a class.
I am going to write what I would do to create such a class and since I know its not gonna be good, I am hoping that someone with better knowledge of OOP can help us understand this.
--------------------------------
A class has its own properties and its own methods. Let's think of a real world example like a soccer ball. A soccer ball has a shape (spherical), a diameter, a raedius (diameter/2), weight, internal pressure and so on and so on. It also has methods (actions): it bounces.
In the same manner the form has properties like name, id and methods like post, get, onSubmit, and so on.
If we were to write a simple class with these in mind it should look something like this draft:
Class someform{
var name;
var id;
function whensubmitted {
do this;
}
}
------------
so far thats been my idea of how to write a class, but where am i going wrong?
----------------
Never bother to learn something not knowing which does not do you any harm, and never neglect to learn something whose negligence will increase your ignorance - Imam Jafar Sadeq
|