I have two classes: Action and MyAction . The latter is declared as:
class MyAction extends Action {}
All I need is a method in the Action class (only in it, because there will be many inherited classes, and I do not want to implement this method in all of them), which will return the class name from a static call. Here is what I am talking about:
Class Action { function n(){} }
And when I call it:
MyAction::n(); // it should return "MyAction"
But each declaration in the parent class has access only to the parent class variable __CLASS__ , which has the value "Action".
Is there any way to do this?
inheritance oop php
Anton 03 Feb '09 at 11:04 2009-02-03 11:04
source share