Chapters
33 Chapters
|
3:02:08
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!Compatible PHP versions: ^7.2.0
Subscribe to download the code!Compatible PHP versions: ^7.2.0
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
33.
Sweet Alert: Create a Promise!
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
This tutorial uses an older version of Symfony... but since it's a JavaScript tutorial, the concepts are still ? valid!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.2.0",
"symfony/symfony": "3.1.*", // v3.1.10
"twig/twig": "2.10.*", // v2.10.0
"doctrine/orm": "^2.5", // v2.7.1
"doctrine/doctrine-bundle": "^1.6", // 1.10.3
"doctrine/doctrine-cache-bundle": "^1.2", // 1.3.2
"symfony/swiftmailer-bundle": "^2.3", // v2.4.0
"symfony/monolog-bundle": "^2.8", // 2.12.0
"symfony/polyfill-apcu": "^1.0", // v1.2.0
"sensio/distribution-bundle": "^5.0", // v5.0.22
"sensio/framework-extra-bundle": "^3.0.2", // v3.0.16
"incenteev/composer-parameter-handler": "^2.0", // v2.1.2
"friendsofsymfony/user-bundle": "~2.0@dev", // dev-master
"doctrine/doctrine-fixtures-bundle": "~2.3", // v2.4.1
"doctrine/doctrine-migrations-bundle": "^1.2", // v1.2.1
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"friendsofsymfony/jsrouting-bundle": "^1.6" // 1.6.0
},
"require-dev": {
"sensio/generator-bundle": "^3.0", // v3.1.1
"symfony/phpunit-bridge": "^3.0" // v3.1.6
}
}
7 Comments
Great course!!! Very much looking forward to the next one!!
Hey guys,
Great Tutorial! For future people coding along with this video don't use latest sweetalert version (js and css, currently `7.11.0`) because it won't work with this code, you cannot `catch` alert dismiss with `catch()`. Use version `6.1.0`. Correct me if I'm wrong :)
Hey Radoje Albijanic
Look's like you are right, I just did a quick review over the new changes in the latest version and there are many breaking changes
Thanks for letting us know, I'll talk to the team to see what can we do about it.
Cheers!
Hi
Thanks a lot for this really great tutorial!!
One question:
Is there an easy way to show the flash message after the row is deleted? I know how I can set a flash message in the controller, but the message only appears when the page is reloaded.
Best regards!
Michael
Hey Michael,
Thanks! Hm, interesting question. Probably, the better way do not use Symfony flash messages at all. If the row was successfully deleted on server side - you can just return success AJAX response data with that message and read it with JS, i.e. show it in some bootstrap HTML wrapper to show it in nice styles - see Alerts section in TB docs: https://getbootstrap.com/do... . You can even write your custom method/helper for showing any messages in such styles. And probably, if you do not use translations, you don't even need to return this message from controller, just hardcode that message inside JS code, and when delete request was successful - just show it.
Cheers!
Hey Victor,
Thanks a lot for this detailed answer! It wasn't that easy for me.. but now I used a plugin called Bootstrap Notify (http://bootstrap-notify.rem...) for a really nice styled and animated message ;-)
Cheers!
Michael
Hey Michael,
Good find! I haven't used it by myself, but looks really nice! Btw, thanks for sharing it with us ;)
Cheers!
"Houston: no signs of life"
Start the conversation!