I've been building a web app of my own for a while now, but have completely hit against the wall with a fatal error in PHP.
Short story: I'm working on the login / user section of the project. login.php handles the login stuff, while student.php handles the account stuff.
When trying to complete doLogin, I achieve the fatal error that states student::getProfile() is an "undefined method". student::getProfile() is called as part of validate() inside the login class.
Any assistance would be greatly appreciated! Thanks :)
EDIT: With the help of @deceze I've been able to narrow the issue down to the fact that Composer isn't autoloading all of my classes; only some. Would anyone be able to assist?
EDIT 2: I checked autoload_classmap.php which was generated by Composer, and all my core classes and models are listed! If they're listed in the classmap, why isn't Composer loaded them?
project directory
application/ config/ controller/ core/ (core items such as auth, app, view rendering + view controller) model/ (speciality functions such as login, registration + user) view/ public/ index.php .htaccess vendor/ autoload.php composer.json .htaccess note: /public/index.php calls `require '../vendor/autoload.php';` composer.json
"autoload": { "psr-4": { "": [ "application/core/", "application/model/" ] } }
Call to undefined method student::getProfile() in login.phpecho "I'm included!"to it. The only other explanation would be namespaces, and/or invisible characters in your code somewhere; i.e. the name of the class or function is actually different.