class A declared at namespace1.
namesapce namesapce1;
class A
{
public static function fun1()
{
}
}
I want to use fun1() inside class B:
namespace namesapce2;
use ???? as fun1
class B
{
public static func2()
{
fun1();
}
}
How to do that ?
namespace namespace2;
use namespace1\A;
class B
{
public static function func2()
{
A::fun1();
}
}
Assuming you're using something that does autoloading or the necessary includes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With