is not recognized by the code - Slim is not a compiler, it is a framework.
The code will execute to the PHP compiler standards, therefore using the default.
use SomeNamespace\SomeClass as SomePrefix;
Will work no matter what you're trying to achieve. The require_once()
method loads your PHP file holding the class, which I assume doesn't have a custom namespace since you're targeting the \
directory.
If you're working inside a class then this might be your issue, your code should run similar to this after using the require_once()
to load in the ParseMarkdownClass
file.
use ParseMarkdownClass as Md;
class SomeClass
{
public $container;
public function __construct()
{
$this->container = (object)['m' => function() {
return new Md();
}];
}
}
(new SomeClass())->$container->m()->...