Prev: Vermis - new issue tracker in PHP
Next: Syntax Error
From: "Matt Palermo" on 3 Oct 2010 12:09 Is it possible to create a global namespace alias in PHP or does the alias have to be defined in EVERY file that I use? Here is an example: file: main.php <?php use \this\is\my\custom\namespace\Item as nsItem; ?> file: index.php <?php require_once âmain.phpâ; // Attempt to use namespace alias defined in main.php file nsItem::test(); ?> The above code doesnât work for me. The namespace alias defined in the main.php file isnât accessible in the index.php file. Is there a way to make the ânsItemâ alias a âglobalâ one, so that I donât have to define it in EVERY file that I want to use? -Matt
|
Pages: 1 Prev: Vermis - new issue tracker in PHP Next: Syntax Error |