Is it possible to do something like self::
in PHP to not need to specify the class-name tro call a static method within the same class. See how I do it:
public class Foo
public static void blaa() {...}
public void foobar
{
Foo.blaa();
}
but I'd like to it like
public class Foo
public static void blaa() {...}
public void foobar
{
_SOME_SORT_OF_SELF_.blaa();
}
to not have to write down the classname over and over again...
same would go for static attributes. Instead of using Foo.MY_ATTR
maybe accessing it via _SOME_SORT_OF_SELF_.MY_ATTR
.
Possible? Thanks
blaa()
. WIthout any prefix. I find it clearer with Foo.blaa(), but you're not forced to add the class name if it's the current class. – Nodule