Тёмный

Symfony 4 Beginners: Dynamically modify a form (AJAX) 

OverSeas Media
Подписаться 10 тыс.
Просмотров 37 тыс.
50% 1

Опубликовано:

 

22 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 63   
@MarcoAntonio-gi4tz
@MarcoAntonio-gi4tz 6 лет назад
Hey man, I just discovered the series. I will watch them all. In a time where there are tons of Laravel tutorials. I find this channel outstanding. keep going!
@OverSeasMedia
@OverSeasMedia 6 лет назад
Thank you so much for taking the time to say those kind words. I absolutely appreciate it . Cheers mate :))
@larsstecken
@larsstecken 5 лет назад
At times a bit rushed, but hey, I learned more than by studying docs for hours. Real-world problems explained really well. Thanks for sharing and as the others say - can't wait for the next one.
@gerseystelmach6501
@gerseystelmach6501 11 месяцев назад
Thank you very much! You saved my day!
@jean-martinfernand8068
@jean-martinfernand8068 Год назад
Thank you Sir. Still valid today. Made my day !
@rickaxelmouwendzilegandza3663
@rickaxelmouwendzilegandza3663 3 года назад
Thank you. But, How to do the same thing with 3 fields one after the other?
@szymond.9048
@szymond.9048 2 года назад
And what if I want to add nother field based on subcategories field? How can I achieve that?
@zahidkhankhan
@zahidkhankhan 4 года назад
excellent work offcourse its help a lot to understand the missing puzzles.. keep going man ..
@Question_Authority
@Question_Authority 3 года назад
This video has been really useful to me, thanks man!
@OverSeasMedia
@OverSeasMedia 3 года назад
I'm glad it was helpful mate. Cheers :)
@Evilmaster667
@Evilmaster667 3 года назад
Great tutorial! But I get a database entry for the onchange function and another for the submit type. Why is this happening? Normally the entry should have been updated, right?
@ValeriyTuz
@ValeriyTuz 2 года назад
Hi. Many thanks for the tutorial! I did similar functionality in Symfony2 and now going to do the same with Symfony5. When I did it in Symfony2 - the doc and tutorials were to the events PRE_SUBMIT, not the POST_SUBMIT. But new docs says to use POST_SUBMIT. And I'm wondering - why? What is the benefit of using POST_SUBMIT. I did not dive very deep yet into it but for the moment it seems to me that POST_SUBMIT looks more complicated: you have to get the element of form and then getParent since in PRE_SUBMIT you work with array of formData
@0ElChaza0
@0ElChaza0 6 лет назад
This was a very clear video thank you so much man!! After all the headaches lol... i'll get into it again and see if i can adapt it to my code. Greetings from Argentina.
@OverSeasMedia
@OverSeasMedia 6 лет назад
Hey there dude . I hope this will kind help get the result you're looking for . And thanks fr the idea in the first place lol . You inspired this video actually . Cheers and good luck man :))
@linomoreau376
@linomoreau376 2 года назад
Hello, I have a little problem and I'm stuck. When I send my data with ajax I get this error: - Expected argument of type "string", "null" given at property path "username". I believe the data submitted to my controller's method that creates the form is causing a problem.
@asialata2781
@asialata2781 2 года назад
Please help ! I cant see any data in my "subcategory" form field and i cant see what i did wrong. Do you know what the reason can be? thanks a lot!
@OverSeasMedia
@OverSeasMedia 2 года назад
Hey sorry I was not aware of you issue just got around to reading comments, I hope you managed to fix your issue.
@ZahidHasan-jf3ne
@ZahidHasan-jf3ne 3 года назад
How can I add EntityType add new like collectionType or like sonata admin EntityType add new. Please ans sir. Thank you.
@Question_Authority
@Question_Authority 3 года назад
Hey, Im really curious about how you made the dropdown to work without using the entitytype after ->add(sub_category). it gives me an "Object of class App\Entity.. could not be converted to string... could you give me a hand with that one?? cheers
@OverSeasMedia
@OverSeasMedia 3 года назад
Hello there mate, I can see the line you're referring to, I think the problem in your case is that the class that you're using does no implement the __toString function? so that could probably fix the issue (Not sure though), so try adding the function inside the class that is in the error "Object of class App\Entity\ThisClass" and just return some string value and if that does not work, let me know. Cheers mate :)
@Question_Authority
@Question_Authority 3 года назад
​@@OverSeasMedia Yes sir, that worked perfectly. Thanks a lot, Appreciate your reply!
@youssefessaddik3372
@youssefessaddik3372 5 лет назад
tks a lot , what if there more than 2 select ? what should we do on that case ?
@ragiththomas9510
@ragiththomas9510 5 лет назад
I watched all your tutorial series of Symfony4, it's very clearly explained and very useful. Thank you very much.
@OverSeasMedia
@OverSeasMedia 5 лет назад
You're most welcome and thank you for the nice comment really appreciate it, I'm glad this was helpful . Cheers mate :)
@ragiththomas9510
@ragiththomas9510 5 лет назад
If I include, use symfony\Component\HttpFoundation\Request at the top of my controller just below the namespace App\Controller, it showing the error like class "symfony\Component\HttpFoundation\Request" but no such service exists. What should I do for this, actually I am new to Symfony so I was referring your video
@OverSeasMedia
@OverSeasMedia 5 лет назад
Hey there could you please tell me where are you using this ? Is it a function inside the controller? Also try changing the use from symfony to Symfony (capitalized) that might be source of the problem.
@ragiththomas9510
@ragiththomas9510 5 лет назад
Actually, I was trying to create a Routing as you did in the 6-Symfony 4 Beginners The Controller tutorial video. I have created a function name as "show" inside the controller and passing the parameters ( Request $request, $slug) and the Route mentioned as @Route("/test/{slug}", name="test") and, I have written use Symfony\Component\HttpFoundation\Request at the top of the controller class just below the namespace App\Controller then, if I execute in the browser as 127.0.0.1:8000/test/2 , I get the error as Class "symfony\Component\HttpFoundation\Request" but no such service exists
@OverSeasMedia
@OverSeasMedia 5 лет назад
Did just check that out didn't misspell symfony in the use statement . Bellow the namespace it should be "use Symfony...." And not "use Symfony..." (Pay attention that the "s" in symfony should be capitalized
@parijke
@parijke 4 года назад
Actually this is what I meant. Forget my question on your latest video! Again, very helpfull
@OverSeasMedia
@OverSeasMedia 4 года назад
Sorry I'm quite late but I'm glad you found this :)
@abdb7174
@abdb7174 6 лет назад
thank u man please we're waiting for a real project on symfony 4
@OverSeasMedia
@OverSeasMedia 6 лет назад
You're most welcome I'll see if I can make something together and start recording it sometime in the future . Cheers and thank you again. :)
@Question_Authority
@Question_Authority 3 года назад
Mate, here I go again... I made the listener work but... do you add the SubmitType in the view? cuz it 's certainty not in the form, cant figure
@OverSeasMedia
@OverSeasMedia 3 года назад
Yes I might've added it in the view I cannot remember . You can add It in the type of you want, the important thing is to have a way to submit the form :)
@HorrorShow
@HorrorShow 5 лет назад
Interesting tutorial, thank you very much, but what would have to change if the relationship between post and subcategories was ManyToMany?
@OverSeasMedia
@OverSeasMedia 5 лет назад
Thank your for your feedback . It's been quite a while and I don't remember exactly what I did in this video lol . But I assume that you want to chat get the drop-down list of subcategories right ? Which means you want to be able to select multiple subcategories (like a tags system) correct? Well if that's the case I can point you to a video that I made when I was just getting started with this channel and it's called custom type , it's kind of a long video so you can just skim through it and see it's any help, if it was helpful you just have to combine the two things together. If that's not what you're looking for then feel free to send me an email explaining what you're trying to do and we can discuss it more :)
@HorrorShow
@HorrorShow 5 лет назад
@@OverSeasMedia No problem, I solved it. Although this code is still magic for me, I still don't understand why it works. The FormEvents operates in POST_SUBMIT, however, jQuery detects the change in the Category field without submitting, in real time, but each time the user changes Category the jQuery emulates a submit and replaces the old subcategory field with the one that returns the POST_SUBMIT form? It's a bit confusing, but it works!
@OverSeasMedia
@OverSeasMedia 5 лет назад
Yeah that what happens . If it doesn't make sense at the moment . Just come back to it later . This type of things happens :)
@adrianfgutierrez2836
@adrianfgutierrez2836 4 года назад
Woowwwww excelent work ✌🏽
@mohamedaymenabdennour7918
@mohamedaymenabdennour7918 4 года назад
Thank you
@bettonvillebenoit1533
@bettonvillebenoit1533 5 лет назад
Great ! ... but could you explain how can we implement this in a embbeded form ? I tried it but I have an error because getData() return Null. Thx :-)
@OverSeasMedia
@OverSeasMedia 5 лет назад
Aight hold on a second this is gonna require some serious attention lol, which function or line is returning null for the getData(), do you have a repository for this ? Looking at the code is much better thank just interrogating you haha. (Sorry for the late response :) )
@bettonvillebenoit1533
@bettonvillebenoit1533 5 лет назад
Hi, Oops ... it's my fault ! I did a typo in the code ... It's works !! Thanks for you video ;-)
@mahdibeldjoudi3269
@mahdibeldjoudi3269 5 лет назад
thank you so much man
@OverSeasMedia
@OverSeasMedia 5 лет назад
You're most welcome mate . Cheers from Morocco :)
@younex111
@younex111 6 лет назад
hey bro thank you so much for this amazing series lol it 3:12am and im still watching the tutos its really wonderful keep going you are the better in youtube lol and i have i blame for you you start one task and you didn't done it yet. it's the crud with upload image you only upload it and save it so i hope you could make a short video for how to edit it will be awsome its 3 days im looking but no way thank you so much again and god bless you
@OverSeasMedia
@OverSeasMedia 6 лет назад
Hey there youness you're most welcome . I'll definitely see if I can make a short video about that in the shortest time possible . Meanwhile . Get some sleep dude lol . Cheers :)
@younex111
@younex111 6 лет назад
hey bro thank you so much lol i only slept 4 hours from 5am to 9am still looking for fixing this problem if you cant make it soon send me the controller how should be please or a shot screen or anything could help im really stuck and that hurt my mind god bless you bro
@OverSeasMedia
@OverSeasMedia 6 лет назад
Hey there I actually made a video about this before lol and I didn't even realize it . Could you please check the doctrine events video I think the first part covers what you're trying to do . (Not really sure if that's what you're trying to do ) but hey check it out and let me know if it was helpful or not . (Sorry for not mention this before I totally forgot about this)
@younex111
@younex111 6 лет назад
thank you so much brother i guess its very helpfull it use events lol im still didnt get into this level i made mine without events i will show you my shootscreen and let me know please
@younex111
@younex111 6 лет назад
this the link : drive.google.com/open?id=1TcMtx00cw-VdiEG-CvKAng8HfJyO_n5g you will see the controller : ( upload ) + (delete) + (update) and script file only the (update) messed up (@_@) ° ° ° ° i have an other blank night again bro i hope you could help as soon possible thank you again brother
@bolovy6093
@bolovy6093 6 лет назад
Thank you very much bro! +1 like
@OverSeasMedia
@OverSeasMedia 6 лет назад
Thank you very much and I appreciate that mate . Cheers and thanks for the support :)
@chimerablack4913
@chimerablack4913 3 года назад
How can it possibly be this much code and effort to make a dropdown list? No wonder this framework has 0% market share with a total of 13k websites ever. Seems like Symfony needs a new framework built on top of it just to use Symfony. Seriously. If I'm using a framework it should be as easy as "Create:dropdown". Not 3 pages of code. I mean.. are dropdowns a new thing? How many decades does it take to simplify creating them into one command?
@OverSeasMedia
@OverSeasMedia 3 года назад
I agree with you that Symfony takes a lot of boilerplate code to make something really basic, but then it gets absolutely extremely easy to make changes (If you have a really well written code ofc). One other thing about Symfony is that it is used much more on the enterprise level, because it works in a way that kind of forces people to write the same thing and follow the same "coding scheme". If you need help with something feel free to ask, If you decide to not use Symfony I completely understand I myself at first skipped, what ever you decide mate I wish you the best of luck :)) Cheers
Далее
Symfony 4 & Doctrine: QueryBuilder
30:12
Просмотров 22 тыс.
9 - Symfony 4 Beginners: Forms
27:01
Просмотров 24 тыс.
People Cling To Trees As Typhoon Slams Into Shanghai
00:34
Don't Use Websockets (Until You Try This…)
6:46
Просмотров 302 тыс.
Symfony Tutorial: Events
30:02
Просмотров 18 тыс.
All 29 Next.js Mistakes Beginners Make
1:45:10
Просмотров 126 тыс.
Symfony tutorial: Embed a Collection of Forms
1:26:27
Просмотров 32 тыс.
Symfony tutorial: Doctrine Events
56:16
Просмотров 7 тыс.
People Cling To Trees As Typhoon Slams Into Shanghai
00:34