Example:
namespace Somenamespace;
use Somenamespace\Someclass;
use Somenamespace\otherclass;
class Template{
public function display($templ){
load_template($templ);
}
}
function load_template($file){
unset($file);
require func_get_arg(0);
}
$template = new Template();
$template->display('file.php');
Now I want to access "Someclass" in file.php, without having to declare it first in the "use" statement. eg. someclass::dostuff();
(without the namespace)
Is it possible?
Simply: no. See note bellow the example http://www.php.net/manual/en/language.namespaces.importing.php#example-247