1
When I use an architecture like MVC in a PHP project separating the models
, controllers
, services
, views
often using the functions include
or require
the application gets lost importing the PHP files located in other directories, and for that you need to pass the path of the full disk of the file location in order to prevent a PHP file inside the directory model
to be imported is sought in /controllers/model
where this problem often occurs when going back directories (../
) for example.
I wonder if it is possible to import these files using the URL instead of the disk path because you do not need to keep entering or going back to each directory.
So it could matter simply by passing: /controllers/TerceiroController.class
, for example, or localhost/projeto/controllers/TerceiroController.class
rather than /var/www/html/...
What is happening that are negativizing our question and answers? I didn’t know about this +1
– Giancarlo Abel Giulian
It is the headquarters of ranking that is inhabiting some users here.
– Renan Cavalieri
Have a repository on Github to indicate that you use the namespace feature including?
– Giancarlo Abel Giulian