Drupal 8 Programatically created custom form.

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024

ความคิดเห็น • 32

  • @ps2k12
    @ps2k12 5 ปีที่แล้ว +2

    Very nice and simple tutorial, best for beginners. Rather than confusing beginner developer with lot of code and terminology you have simply explained everything with minimal code possible. After this we can easily create complex forms and add our logic to submit function.

  • @skyyfiman
    @skyyfiman 6 ปีที่แล้ว +3

    Gives me a better understanding of how Drupal works.
    I will definitely be checking out your Udemy course!
    Thank you for this very helpful tutorial.

  • @sorenbaird
    @sorenbaird 5 ปีที่แล้ว +2

    This is exactly what I was looking for. Thank you!

  • @Rahulpandey-jn1xb
    @Rahulpandey-jn1xb 5 ปีที่แล้ว +1

    Nice Tutorial for form creation in D8. Thanks!

  • @hamadkhan2641
    @hamadkhan2641 6 ปีที่แล้ว +2

    Extremely Great Video, give a thorough understanding! Thank You.

  • @jasramihajarivelo3563
    @jasramihajarivelo3563 5 ปีที่แล้ว +2

    Thank you,
    you always have a great tutorial, and it's easy to learn

  • @elvinxhimitiku5971
    @elvinxhimitiku5971 4 ปีที่แล้ว

    great tutorial! would love to see more of these

  • @meck1832
    @meck1832 6 ปีที่แล้ว +2

    This is a great tutorial, i appreciate very much your work, thank you so much.

  • @lakshaykumar8757
    @lakshaykumar8757 3 ปีที่แล้ว +1

    Thanks for this :)

  • @SoundPeaks
    @SoundPeaks 3 ปีที่แล้ว +1

    drupal_set_message doesn't work in 9.2.x
    \Drupal::messenger()->addStatus(t('Successful message.')); can be used

  • @TechNomadYash
    @TechNomadYash 4 ปีที่แล้ว

    Great explanations, thanks man

  • @flashies8833
    @flashies8833 5 ปีที่แล้ว +3

    It gave page not found what should I do?

  • @gaetanoleoni7370
    @gaetanoleoni7370 4 ปีที่แล้ว

    Hi Nikolay, your videos are simple and clear.
    One question, is it possible to calculate between the two numbers not while saving but while typing?
    Example we add another field called sum. When I type 10 in number_1 I add the value of number_1 and number_2 in sum.
    Then if you want you can submit it. In this way you have the result of the work before submitting.
    Thank you

  • @hemalatavishnumahajan3706
    @hemalatavishnumahajan3706 3 ปีที่แล้ว

    Very helpful Thank you so much

  • @gauravsinghnegi3976
    @gauravsinghnegi3976 4 ปีที่แล้ว

    Please make vedio on how we create and dispaly two form in one page

  • @nilu2003ad
    @nilu2003ad 4 ปีที่แล้ว

    Great tutorial. I'm going to create a custom form and assign it into a custom block. I then assign the custom block into a region. Anonymous users can see the form however admin or authenticate users are unable to view the form. What is the reason?

  • @talhayaseen4898
    @talhayaseen4898 4 ปีที่แล้ว

    I need help in creating widget for a custom module for my intern. I would be very thankful of you if you could help me.

  • @DevLatBo
    @DevLatBo 6 ปีที่แล้ว

    HI Drupal Up I need your help... do you have any example about how to pass varialbes when you create a block in order to show more content in that block custom... i've been trying hard and i didnt have success about it... please help :(

  • @sander7782
    @sander7782 3 ปีที่แล้ว

    well this is very clear.. but how are you doing this out of the top of your head?

  • @anuraggupta1538
    @anuraggupta1538 4 ปีที่แล้ว

    as of today, book code, drupal site example, other blog example module not worked for me. But this procedure worked nicely. I curse Drupal

  • @jadetaboada447
    @jadetaboada447 6 ปีที่แล้ว +1

    is there a file in #type? just wondering :)

    • @Drupal-up
      @Drupal-up  6 ปีที่แล้ว +2

      Hi Jade, actually there is such #type -> here is the documentation api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21File.php/class/File/8.2.x
      Submitting the form with this type of field would be a bit trickier though. Also as you go to this page -> api.drupal.org/api/drupal/elements/8.5.x you may see all the possible types of fields that you could use in your custom forms. Cheers!

    • @jadetaboada447
      @jadetaboada447 6 ปีที่แล้ว

      one more question can i inject the from into my controller?

    • @jadetaboada447
      @jadetaboada447 6 ปีที่แล้ว +1

      thanks

    • @Drupal-up
      @Drupal-up  6 ปีที่แล้ว

      That is a very good question! You would not inject the form directly though. You would have to inject the form builder service.
      Here is how you would use the form builder service in a .module file:
      $form = \Drupal::formBuilder()->getForm('Drupal\myModule\Form\MyModuleForm');
      In the controller though it is a bad idea to get the formBuilder service like that. You would have to use Dependency Injection. Here is an example on how to implement DI with a controller:
      gist.github.com/flesheater/e321b8433e0626d9a76aaa6ffa4f8b81
      This is the documentation for the form_builder service:
      api.drupal.org/api/drupal/core%21core.services.yml/service/form_builder/8.6.x
      In the example it is implemented with the request_stack service - you should do it with the form_builder.
      Cheers and good luck!

    • @jadetaboada447
      @jadetaboada447 6 ปีที่แล้ว +1

      Thanks again my friend. :)