Now that we have our folder structure and the rewrite functionality working, we can begin setting up our MVC-based application. The first thing that we will have to focus on would be to bootstrap our application by loading the required classes. We are storing these required classes in the
lib folder and we will use the
config.php file to store the required configurations such as the location of the
lib folder, the base URL for our application, and the database connection information.
<?php define('LIBRARY', 'lib/'); define('BASE_URL', 'http://localhost/student-portal/'); define('DB_VENDOR','mysql'); define('DB_HOST','localhost'); define('DB_NAME','course_registry'); define('DB_USR','root'); define('DB_PWD','top_secret_pwd');
Let us ...