Jump to content
SecretService

PHP Namespace + spl_autoload

Recommended Posts

Am structura urmatoare:

/var/www/Proiect1/Proiect1.php

/var/www/Proiect1/User/UserProfile.php

In Proiect1.php:


spl_autoload_extensions(".php");
spl_autoload_register();
use User\UserProfile;
...

In UserProfile.php:


namespace Proiect1\User\UserProfile;
...

Cand rulez Proiect1.php:

Fatal Error: spl_autoload(): Class Proiect1\User\UserProfile could not be loaded

Aveti vreo idee?

Edited by SecretService
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...