Most voted "psr-4" questions
10 questions
Sort by count of
-
14
votes2
answers1408
viewsHow and when should we use Interface to document systems in PHP?
I always wondered exactly, if it is a good practice, to make a system always making use of Interfaces, or this is not necessary? Interface People { public function getName(); public function…
-
8
votes1
answer823
viewsPSR-4 on an MVC project or not?
I have two codes, the first one uses spl_autoload_register and the other does not, however the second loads "automatically the class" also. With spl_autoload_register Uses namespaces to split MVC…
-
5
votes1
answer553
viewsHow to configure Autoload Composer?
I am facing a lot with this autoload in php, I decided to study about it, I could understand a good part, but I have only one very specific doubt. Inside the archive composer.json, in the stretch:…
-
3
votes1
answer84
viewsMy php system is working on Windows but is giving error on UBUNTU
I’m using auto-load PSR-4. The error is as follows: Fatal error: Uncaught Error: Class 'App Models Bll Professor' not found in /var/www/html/unaprojetos/App/Controllers/Professor.php:12 Stack trace:…
-
2
votes1
answer930
viewsAutoload PSR4 class
I would like to create a class of autoload to follow the recommendations of PSR4 which can be used jointly and independently of the autoload of the Composer. The application I’m creating will have…
-
1
votes1
answer550
viewsHow to use psr-4 in the Composer with different subfolders
I am creating a test framework. I use Composer to create the structure of my project. The file Composer.json looks like this: { "autoload": { "psr-4": { "App\\": "src/app/mvc/" } } } I divided my…
-
0
votes0
answers83
viewsProblem with Composer - PSR-4
I am studying Composer and its autoload forms (classmap, file, psr-0, psr-4), but in my example it is appearing with the following error: Fatal error: Class 'Library\Exemplo' not found…
-
0
votes1
answer291
viewsMy autoload by Poser is not working
I am learning to autoload using Composer, but am getting the following error while running the tests: Fatal error: Class 'App Model Database' not found in /var/www/Library/index.php on line 5 it’s…
-
0
votes1
answer249
viewsProblem with PSR-4 and Poser autoload
I’m having a problem with Poser’s autoload, the structure and code are all right, only he’s not finding the class. I’ve already updated the autoloads by bash and nothing... anyone knows what it…
-
-1
votes1
answer30
viewsError finding class in application using namespace
I am implementing the namespace with psr-4 in a small PHP application and it turns out that he is not finding the class Mvc\Controller\MyController and I don’t understand the cause The folder…