Share icon
custom form with menulink drupal 8

Hi guys, In this article we see how we can make custom form with a menu link in drupal 8. Some of criteria of creating is changed form drupal 7 but it is quiet to understand the new setup, so let's start

For this we need to create a custom module so create a folder and make info.yml file 

1) Create modulename.info.yml file

2) Create routing.yml file for menu link and define the form page

3) Create the src/form folder and under it create "CustomForm.php" that we define under our routing file.

Now Enable the module from UI and go to http;//yourwebsite/my-menu-form and you will see the form after submit all process form elements will display under drupal_set_message

you can use them for your purpose.

Hope this articles helps.

GITHUB URLhttps://github.com/key2goal/module-with-a-form-and-menu-link

Comments

Profile picture for user kassandraspear6603821
Anees (not verified)
30 Jul 2022
Awesome post found on google, I am new on drupal 8 module creation and that example helps me very good
Profile picture for user kassandraspear6603821
betsy751869334… (not verified)
30 Jul 2022
Hello, I do think your site may be having browser compatibility problems. Whenever I look at your site in Safari, it looks fine however, if opening in IE, it has some overlapping issues. I merely wanted to provide you with a quick heads up! Aside from that, wonderful blog!
Profile picture for user kassandraspear6603821
cortneystanfill4473 (not verified)
30 Jul 2022
Hi there, I check your blog like every week. Your writing style is witty, keep it up!
Profile picture for user kassandraspear6603821
veronag040535061701 (not verified)
30 Jul 2022
Thanks for the auspicious writeup. It in fact was a enjoyment account it. Look advanced to more introduced agreeable from you! However, how can we keep in touch?
Profile picture for user kassandraspear6603821
finleyrausch95382245 (not verified)
30 Jul 2022
Hi Dear, are you genuinely visiting this web page regularly, if so afterward you will without doubt get pleasant know-how.

Add new comment

Restricted HTML