Hi,
I just develop an API using slim framework. Implementing controller functionality i got error.
This is the way of am implementing
I just create a folder controllers in src folder
Then add new file HomeController.php with
namespace src\Controllers;
class HomeController
{
public function getuser($request,$response,$args)
{
var_dump($request);
}
}
then add dependencies.php file
$container['HomeController'] = function ($c)
{
return new src\Controllers\HomeController;
};
Then add router file
$app->post(’/getuser’,‘HomeController:getuser’);
I got this error
Fatal error: Class ‘App\Controllers\HomeController’ not found in /var/www/html/doothdvlp/api/v1/src/dependencies.php on line 39
Please help me