I want to create two modules for two forms. How can I achieve that? Namespace of both file will get conflict or not?

I am trying for this, and getting one error don't know its because of the two form or not.

Folder structure1:


Folder Structure2



InvalidArgumentException: Class "\Drupal\amazing_forms\Formss\ContriForm" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 29 of C:\xampp\htdocs\drupal8\core\lib\Drupal\Core\DependencyInjection\ClassResolver.php).

I have a question: Controller name should be Form only or we can use any other name for other modules as I have used above?

  • This is hard to answer because at a glance all your errors are a result of typos. Beyond that, there is no code listed, and I bet there are typos in your namespace declarations, too. Every form lives under src/Form. ContriForm does not exist is a legitimate error because it doesn't exist, it should be ContributeForm.
    – Kevin
    Jan 17, 2017 at 14:59


Browse other questions tagged or ask your own question.