I’m trying to find a way to mass apply these namespaces, as this would be inconvenient to write out. I know I can simply do, use jream\ as j but I would like to see if it’s possible to avoid the backslash.
require '../jream/Autoload.php';
use jream\Autoload as Autoload,
jream\Database as Database,
jream\Exception as Exception,
jream\Form as Form,
jream\Hash as Hash,
jream\Output as Output,
jream\Registry as Registry,
jream\Session as Session;
new Autoload('../jream');
Isn’t there a way to say something along these lines: jream\\* as *; ?
Any tips would be appreciated 🙂
At the very least you can skip all the redundant
asaliasing:If you want to use everything in the namespace without typing it out one by one, then indeed the only real choice is to alias the namespace as a whole and use a backslash: