namespaces

PEAR, Smarty, ADOdb, OOP, PHP 5, XML, UML, Şabloane de proiectare, PHP-GTK.

Moderatori: coditza, Emil, Moderatori

skullipso
Junior Member
Mesaje: 30
Membru din: Mie Noi 04, 2009 5:06 pm
Localitate: Pitesti
Contact:

namespaces

Mesajde skullipso » Mie Apr 21, 2010 4:00 pm

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? :(


Skullipso

arhimede
Junior Member
Mesaje: 39
Membru din: Lun Dec 05, 2005 6:54 am
Contact:

Mesajde arhimede » Mie Apr 21, 2010 7:01 pm

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

skullipso
Junior Member
Mesaje: 30
Membru din: Mie Noi 04, 2009 5:06 pm
Localitate: Pitesti
Contact:

Mesajde skullipso » Mie Apr 21, 2010 7:08 pm

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
Skullipso

corsar
Average Member
Mesaje: 87
Membru din: Sâm Ian 12, 2008 4:39 pm

Mesajde corsar » Mie Apr 21, 2010 9:23 pm


skullipso
Junior Member
Mesaje: 30
Membru din: Mie Noi 04, 2009 5:06 pm
Localitate: Pitesti
Contact:

Mesajde skullipso » Mie Apr 21, 2010 9:36 pm

Skullipso


Înapoi la “PHP Avansat”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 6 vizitatori