I am trying, to create a PHP representation of a HTML form; it break down into essentially 3 levels of classes:
class form {}
class block extends form{}
class control extends block{}
My main issue with this is that certain methods and attributes should not be inherited by the children.
For example:
class form { action="http://url.com";}
But I don't want new blocks or controls to have the property "action". ( I was supposing I could UNSET this in the class description or constructor , still that seems clumsy and what would I do about methods you can't UNSET a FUNCTION can you??)
I considered reversing the creation order of my classes, but it's the same issue, I would not want a form to have a "label" property, inherited from the control class.
I could make the 3 unrelated classes, but since many properties and functions do overlap ( name, CSSID, CSSclass, etc.) this seems like it would cause a lot redundant code.
I guess my question is is there a way to OMIT certain properties and methods from begin inherited by child classes? Any other suggestions will also be gladly entertained.





Reply With Quote
Bookmarks