www/.htaccess
make sure apache is installed and enable Mod_Rewrite:
$ a2enmod rewrite
Auto-load PSR-4
Let's use the PSR-4 pattern in a PHP project through the Composer dependency manager itself.
In the composer.json file we configure the vendor namespace
and the main folder from where the sub-namespaces will be created:
After configuring the project's namespace, run:
$ composer dump-autoload
src/view/index.php
src/Controller/Index.php
Suggestion
Manage the
view layer with component
Resource
or any other template engine of your choice
www/index.php
URL
http://localhost/my-project/www/
Kickstart
Save time creating an MVC from scratch using
kickstart to start your project from scratch
and use other components according to the application's needs