[TYPO3-dev] new DOMDocument error

Jost Baron jost.baron at gmx.de
Tue Aug 12 19:24:51 CEST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Nikola,

das Problem ist, dass die Klasse DOMDocument im namespace
XXX\YYYYYYYYY\Controller gesucht wird, wahrscheinlich weil du die
Direktive

namespace XXX\YYYYYYYYY\Controller;

in der fraglichen Datei hast. Die Klasse liegt aber im Root-Namespace,
den musst du bei der Instanziierung angeben. D.h. mit folgender Zeile
sollte es klappen:

$dom = new \DOMDocument("1.0");

Gruß Jost

On 08/12/2014 07:01 PM, Nikola Vignjevic wrote:
> Hi folks,
> 
> I just try my first steps in MVC Extension development and have
> already a problem.
> 
> the simple Line:
> 
> $dom = new DOMDocument("1.0");
> 
> throws a Error:
> 
> Fatal error: Class 'XXX\YYYYYYYYY\Controller\DOMDocument' not found
> in 
> /var/www/virtual/test.de/my_domain/htdocs/typo3conf/ext/xxx_yyyyyyyy/Classes/Controller/CentralController.php
>
> 
on line 118
> 
> If I try the same line without typo3, everything is fine, and I
> didn't write:
> 
> $dom = new XXX\YYYYYYYYY\Controller\DOMDocument();
> 
> So why he is looking there? It actually have to be a simple part of
> PHP and not part of typo3 MVC or so. Where is my mistake?
> 
> Please a little hint..
> 
> Nik

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlPqTeAACgkQNme/yCvmvTIp7ACeK/zaajJKkaAcbkSsHyKuC73w
vvMAn02ZKQcpagBPZNx0GAl54KtWFRpB
=J3il
-----END PGP SIGNATURE-----



More information about the TYPO3-dev mailing list