Symfony tutorial: Embed a Collection of Forms

Поделиться
HTML-код
  • Опубликовано: 17 май 2018
  • WATCH THE VIDEO AT A HIGHER SPEED ITS MUCH BETTER.
    Okay In this symfony 3 tutorial i went through how you can embed a collection of forms, which simply means including a form within a form if that makes any sense to you, and here's what this video covers basically:
    - Configuring your symfony application to use sqlite instead of mysql.
    - Using bootstrap as a theme for Twig templating engine.
    - Creating entities and relationships in Doctrine 2.
    - Creating forms that the user can interact with.
    - Javascript and jQuery which help us generate and remove forms dynamically.
    There was a lot of editing on this video because debugging was taking so much time and i didn't want to make the video any longer.
    Timestamps:
    - Demo and setting up the app and stuff
    - JS part starts at: 33:36
    - Database persistence starts at:01:09:18
    - Back to the JS starts at: 01:15:20
    Github project:
    github.com/konshensx16/embed-...

Комментарии • 65

  • @jedugomes
    @jedugomes 5 лет назад +13

    This video was very useful for my studies with Symfony embedded forms.
    No need to apologize for the duration of the video.
    The Symfony documentation on the subject does not provide many details. You amplified this documentation, which helped me clarify several points, especially regarding the use of jQuery.
    It takes a lot of confidence to run a tutorial like this and fix the bugs as they appear. You gave a perfect live demonstration of what happens in the everyday life of a true developer. Congratulations.
    I hope you continue to perfect your skills. Never stop sharing your knowledge with the community, since you have a gift for it. Thank you very much!

    • @OverSeasMedia
      @OverSeasMedia  5 лет назад +3

      Hello there Eduardo,
      The problem with the video duration is that it kind of drives people away when they see an hour and a half long video, it's not like I'm mad because they're not going to watch it there for not a lot of views for me, but I wish there was a way to tell them this is the best I could do it because of all of thing you have to explain, but anyways .
      I want to say thank you for taking the time to write such an motivational comment, this is so nice if you and I appreciate it so much, I wish you the best of luck .
      Cheers mate :)

  • @soukainamabchour6245
    @soukainamabchour6245 4 года назад +2

    I've been struggling with my project for days and this video was very helpful, thank you so much !

    • @OverSeasMedia
      @OverSeasMedia  4 года назад

      You're most welcome soukaina .
      Cheers and good luck to you :)

  • @kainguyen2859
    @kainguyen2859 2 года назад

    just found tihs video and you were an amazing help. I had to struggle with the entities and setters but in the end figured it out. You deserve a thumps up and subscription

  • @zemtech4325
    @zemtech4325 3 года назад +1

    This guy is a legend!

  • @chrisalmond6159
    @chrisalmond6159 5 лет назад

    Thanks for the video, was trying to make sense of this and your video really helped. Very good details in all your explanations.

    • @OverSeasMedia
      @OverSeasMedia  5 лет назад

      I'm glad that was helpful to you mate .
      Cheers :)

  • @vitaliykirichenkoit
    @vitaliykirichenkoit 5 лет назад +1

    Thanks for the great video! Keep up the good work!

    • @OverSeasMedia
      @OverSeasMedia  5 лет назад +1

      Thank you for the comment mate .
      Cheers :))

  • @jnmldo
    @jnmldo 4 года назад

    Thank you so much for this tutorial!

  • @redazaza2729
    @redazaza2729 5 лет назад +1

    Very nice tutorial !!! proud being from the same country as this guy ;-)

  • @zeinebarfaoui6427
    @zeinebarfaoui6427 3 года назад

    Thank you for this vide, it was really helpful for me even it is too long

  • @user-wv3yi1gl4z
    @user-wv3yi1gl4z 4 года назад

    ty bro, it was very useful for me :)

  • @yosoydeux
    @yosoydeux 4 года назад

    Nice tutorial!

  • @Pidurffi
    @Pidurffi 3 года назад

    AMAZING !!!!

  • @phpdagestan
    @phpdagestan 4 года назад

    thank u very much !

  • @raulcejas3390
    @raulcejas3390 4 года назад

    Great video. Can you explain how install database and project for beginners ?, thank you

  • @toannew
    @toannew 3 года назад

    you saved me ! @@@

  • @malayroy559
    @malayroy559 5 лет назад +1

    Sir, i want to insert multiple experiences for new entry. How it possible, please help me.

  • @tawfikelmsafer352
    @tawfikelmsafer352 5 лет назад

    thank you !

  • @matt15969
    @matt15969 5 лет назад

    Hey man very great video i followed all the steps but i always get this error when i submit "Expected argument of type "App\Entity\Formule", "array" given at property path "formules"."

  • @57Gones
    @57Gones 4 года назад

    Merci ! ce tutoriel m'ayant bien aidé :)

  • @malayroy559
    @malayroy559 5 лет назад

    Thank you so much..

  • @jaspreetmaan121
    @jaspreetmaan121 5 лет назад +1

    i am creating a music database app
    song entity and artist entity have many tot many relationship
    when i add song i have embedded artist form and used cascade persist to automatically insert new artist in artist table and add a song_artist mapping
    but when i want to insert new song with same artist name then it inserts the artist with the same name in new row and creates a new mapping in song_artist table.
    what i want is that when i add a song existing artist then it should not insert new row in artist table but add new row in song_artist mapping table with new song and existing artist.please anyone help me . i am using symfony 4.2

  • @larsstecken
    @larsstecken 5 лет назад

    Thanks for another helpful video. I don't mind learning from your small mistakes :-) Now I just have to transfer this to many to many relations with additional data in the join table. Did you already do a video about that? Cheers

    • @OverSeasMedia
      @OverSeasMedia  5 лет назад

      Hello there Stefan,
      Sorry if I made you watch me debug lol, I think I made one video that contains like very basic many to many relationship it was about creating a custom type. It was one of my first videos I don't even remember the title . Maybe just custom types

    • @larsstecken
      @larsstecken 5 лет назад +1

      @@OverSeasMedia thanks, I think I just started watching it :-)

    • @OverSeasMedia
      @OverSeasMedia  5 лет назад

      Alright man good luck and don't hesitate to ask me any questions if you have any (I might take a long time to answer I can't handle everything that's going on right now lol)

  • @LowRider1500
    @LowRider1500 5 лет назад +1

    thank you very much, can you tell me what linux distribution are you using, and which interface is that, I suscribe.

    • @OverSeasMedia
      @OverSeasMedia  5 лет назад

      Wow bro that was a straight bribe , lol just kidding mate .
      The Linux distribution that I'm using is just Ubuntu . The one in the video is 16.04 the theme i was using for Ubuntu was flatbulous (I probably butchered the name lol), as for phpStorm o think that's the "brogrammer" color scheme.
      Please let me know if those are not the correct things so I can check again.
      Cheers mate :)

    • @LowRider1500
      @LowRider1500 5 лет назад

      @@OverSeasMedia awesome dude, thank you

    • @OverSeasMedia
      @OverSeasMedia  5 лет назад

      You're most welcome :)

  • @oumaimabenjouida6724
    @oumaimabenjouida6724 4 года назад

    hello i have an existing symfony project when i try to run it it gave this error [Symfony\Component\Debug\Exception\ContextErrorException]
    Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
    Please Help !

  • @khushalberwa3452
    @khushalberwa3452 5 лет назад

    Sir please upload video for multiple uploading in sonata admin panel using sonata media bundle

  • @Jimi-bx3xf
    @Jimi-bx3xf 6 лет назад +1

    the new symfony is 4 is it possible to use a login form with it ?

    • @OverSeasMedia
      @OverSeasMedia  6 лет назад +1

      Yes of course you can, check the documentation for that they have a section for that.

  • @anneleenpeeters1989
    @anneleenpeeters1989 4 года назад

    Thank you for this video!
    I have been working on some student project and everything goes well after seeing this video. But when I code this: e('html_attr') after the data-prototype my form won't be displayed in my template. Is there a solution for this? Or perhaps some tip?

    • @OverSeasMedia
      @OverSeasMedia  4 года назад

      Hello there mate,
      The "e" filter means espace, and in this case what we are telling is that we don't want to render the html raw we just want it as test, so that it does not interfere with the parent form, is this case you are having or something else is wrong?

    • @anneleenpeeters1989
      @anneleenpeeters1989 4 года назад

      @@OverSeasMedia
      Thank you for this quick response! So I have been looking at my code and I don't see anything wrong.
      This is my twig template:
      {% for row in form.client %}
      {{ form_row(row) }}
      {% endfor %}
      This is my form:
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
      $builder
      ->add('kamer', EntityType::class, [
      'class' => Kamer::class,
      'expanded' => true,
      'label' => false,
      'required' => true,
      ])
      ->add('aankomst', DateType::class, [
      'widget' => 'single_text',
      'required' => true,
      ])
      ->add('vertrek', DateType::class, [
      'widget' => 'single_text',
      'required' => true,
      ])
      ->add('client', CollectionType::class, [
      'entry_type' => ClientForm::class,
      'by_reference' => false,
      'allow_add' => true,
      'allow_delete' => true,
      ]);
      }
      This is my controller:
      /**
      * @Route("/reservatie", name="app_reservatie")
      */
      public function index(Request $request, EntityManagerInterface $em)
      {
      $form =$this->createForm(ReservatieForm::class);
      $form->handleRequest($request);
      if($form->isSubmitted() && $form->isValid()){
      /** @var Reservatie $reservatie */
      $reservatie = $form->getData();
      $em->persist($reservatie);
      $em->flush();
      }
      return $this->render('reservatie/index.html.twig', [
      'controller_name' => 'ReservatieController',
      'form' => $form->createView(),
      ]);
      }
      Is there anything that you can see where I missed something?
      Thanks alot!
      Greetings from Belgium

  • @ravichandra1830
    @ravichandra1830 4 года назад +2

    I download you repository but i don't how to run into in my local system. Iam using xampp server in my local can you help me ?

    • @OverSeasMedia
      @OverSeasMedia  4 года назад

      Hello there mate .
      The process is really simple just out this file in your htdocs and then access the application just like I did in the video using the same route, of course you still have to change the database parameters to match your computer and run the migrations to create and update the database schema.

  • @hilalfarooq7987
    @hilalfarooq7987 5 лет назад

    Sir make videos about Symfony 3.4 from Scratch. Its Tough to understand the Docs

  • @saidmounaim6550
    @saidmounaim6550 6 лет назад +1

    Thanks we need tutorials events & services

    • @OverSeasMedia
      @OverSeasMedia  6 лет назад +2

      Yoire most zelcome . I'll see what I can do about that :)

    • @ShambhuKumar-hh2ht
      @ShambhuKumar-hh2ht 6 лет назад

      I look for solr bundle which one should I need to use?

    • @OverSeasMedia
      @OverSeasMedia  6 лет назад

      Hey Kumar, i actually never got the chance to use any of that, so you just see whatever suits you better and do the job for you, if you got confused,just look for the most popular one and see how it goes .

  • @solomonekong3777
    @solomonekong3777 4 года назад +1

    Yes, this video was and is still very useful to me, but please, can you make a similar video in symfony 4?
    Please, i really need your help in that.
    thanks a lot OverSeas Media!

    • @OverSeasMedia
      @OverSeasMedia  4 года назад

      Hey Solomon . This video would work also for symfony 4 . The only thing that is different is the structure of the folders and not using bundles, the code is the same

    • @solomonekong3777
      @solomonekong3777 4 года назад

      @@OverSeasMedia
      Ok let me try it out.
      i will let you know how it goes.
      Much thanks.

    • @jnmldo
      @jnmldo 4 года назад

      I used this video as a guide in symfony 4, you can try it!

  • @mikegonzalez4092
    @mikegonzalez4092 6 лет назад

    good tutorial , i have a problem with symfony forms , i want to show one form for each post of a users but i write the form into the for and it is not repeated , how i do it ?

    • @OverSeasMedia
      @OverSeasMedia  6 лет назад

      Hey there Heath,
      Could you please explain what do you mean by creating a form for each post ? do you mean like having a single page displaying like 10 posts and below each post there's a form ? is that what you mean, if no please elaborate more on the idea, thanks :))

    • @mikegonzalez4092
      @mikegonzalez4092 6 лет назад

      exactly that , it's a comments systems , i try to do this :
      {% for post in posts %}
      {{posts.user.username}}
      {{posts.text}}
      {{form(form)}}
      {% endfor %}

    • @mikegonzalez4092
      @mikegonzalez4092 6 лет назад

      i can't see your answer , can you send again ?

  • @lisarios9949
    @lisarios9949 5 лет назад

    +1

  • @toannew
    @toannew 3 года назад

    34:15
    26:51 dump() in hmtl.twig

  • @EgorDemeshko
    @EgorDemeshko 2 месяца назад

    after JS frameworks symfony is seems like a nightmare

  • @devcoach
    @devcoach 4 года назад

    ruclips.net/video/3kMlvIOSnhk/видео.html - та же тема на русском