Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

WwwxxXdbf, procmail "FROM_MAILER" patch, Use of assignment to $[ is deprecated at /usr/local/sbin/apxs line 86. , wwwxxx vim, mysql closing table and opening table, 800c5000, setgid operation not permitted, pciehp: acpi_pciehprm on IBM, WWWXXX.DBF, 078274121

Links

XODOX
Impressum

#1: Is it possible to create a global namespace alias?

Posted on 2010-10-04 16:24:08 by Matt Palermo

------=_NextPart_000_0042_01CB63AE.4737F520
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

ï»=BFIs 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 â€=9Cmain.phpâ€=9D;

// Attempt to use namespace alias defined in main.php file
nsItem::test();
?>


The above code doesnâ€=99t work for me. The namespace alias defined =
in the main.php file isnâ€=99t accessible in the index.php file. Is =
there a way to make the â€=9CnsItemâ€=9D alias a =
â€=9Cglobalâ€=9D one, so that I donâ€=99t have to define it =
in EVERY file that I want to use?

-Matt
------=_NextPart_000_0042_01CB63AE.4737F520--

Report this message