1

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:

modules->custom->amazing_forms
                   ->amazing_forms.info.yml
                   ->amazing_forms.routing.yml
                   ->src  
                       ->Formss
                          ->ContributeForm.php

Folder Structure2

modules->resume
           ->resume.info.yml
           ->resume.routing.yml
           ->src  
              ->Form
                 ->ResumeForm.php

Error:

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?

1
  • 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

0

Browse other questions tagged or ask your own question.