Custom form with our Fibonacci service (WARNING: Dependency Injection included)

Опубликовано: 05 Октябрь 2024
на канале: Drupal Up - Drupal 8 Video Tutorials
691
17

We are going to be injecting our Fibonacci service to a custom form and we are going to use it on form submit.

If you liked this video, please also have a look at my new course about Drupal 8 module development here (with 50% discount):
https://goo.gl/LPyeDw

We are going to create a custom form that is going to have just a text field and a submit button. The idea is that after entering how many Fibonacci numbers we want to generate we are going to click on submit and as a message we are going to see the generated numbers.

In order to achieve that we are going to use Dependency Injection to inject our Fibonacci service and we are going to call it on form submit.

Here is the video on how we created the Fibonacci service:
   • Creating a Fibonacci sequence service...  

The full code of the module you may find here:
https://github.com/drupal-up/drupalup...

More videos and stuff you may find on http://drupal-up.com

To support us please, don't forget to share, subscribe, like and comment on the video!