enter image description here

I wanted to make an API with versions, but it gives an error:

Class api\modules\v1\Module does not exist 

It seems all the ways are right. What could it be?

  • Everywhere namespace s correctly specified? - Ali
  • @Ali Module.php namespace api\modules\v1; - Maxim Vlasov
  • try connecting this module to either the frontend or the backend - Ali
  • Is the class name the same? Sometimes when copying a class, you can rename the file, but forget to rename the class - Ninazu

1 answer 1

You do not have the same path where basePath leads and where is the class itself? Here, look

 'node' => [ 'class' => 'root\modules\node\Module', 'controllerNamespace' => 'root\modules\node\controllers\backend', 'viewPath' => '@root/modules/node/views/backend', ], 

module namespace (Module.php): root \ modules \ node; class namespace (DefaultController.php) root \ modules \ node \ controllers \ backend;

Hope this helps you figure it out.