Pagina 1 din 1

namespaces

Scris: Mie Apr 21, 2010 4:00 pm
de skullipso
am si eu o problema cu implementarea de namespaces.

am asa:

namespace Manager;
class Log implements ILog {
public function __construct() {
$this->doc = new DomDocument ( '1.0', 'UTF-8' );
}
/** rest of the code goes here */
}

dar cand instantiez clasa, imi da urmatorul mesaj:
Fatal error: Class 'Manager\DomDocument' not found in C:\xampp\htdocs\manager\libs\Log.php on line 24
pe linia 24 fiind $this->doc = new DomDocument ( '1.0', 'UTF-8' );

Stie cineva cum pot rezolva aceasta problema? :(

Scris: Mie Apr 21, 2010 7:01 pm
de arhimede
Global space:

Prefixing a name with \ will specify that the name is required from the global space even in the context of the namespace.

vezi daca asta ajuta

Scris: Mie Apr 21, 2010 7:08 pm
de skullipso
adica in loc de $this->doc = new DomDocument ( '1.0', 'UTF-8' ); sa am $this->doc = new \DomDocument ( '1.0', 'UTF-8' ); ?
asta vrei sa zici?

am scris si in modul acesta si tot imi da eroare:
Fatal error: Class 'Manager\DOMDocument' not found in C:\xampp\htdocs\manager\libs\SimpleLargeXMLParser.php on line 43

Scris: Mie Apr 21, 2010 9:23 pm
de corsar

Scris: Mie Apr 21, 2010 9:36 pm
de skullipso